mysql, ERROR 1148 (42000) at line 1: The used command is not allowed with this MySQL version
카테고리 없음 2014. 3. 24. 15:14mysql --local-infile=1 -P3306 -hlocalhost -uUSER -pPASS DBNAME
mysql --local-infile=1 -P3306 -hlocalhost -uUSER -pPASS DBNAME
* 기본 로그인 : administrator / root
* 이메일 인증 없이 사용자 추가:
mysql> update bugtracker.mantis_user_table set password=md5('password') where username='username';
http://blog.naver.com/PostView.nhn?blogId=echris7&logNo=140022430449
find ./ -name '*.txt'
출처:http://ysoftman.blogspot.kr/2010/11/linux-find-paths-must-precede-expression.html
이름에 *TBL* 인 파일 모두 지우기
D:\tmp>for /r %i in (*TBL*) do del %i
#!/usr/bin/perl
#use Mysql;
use DBI;
use DBD::mysql;
# CONFIG VARIABLES
$platform = "mysql";
$database = "MYDATABASE";
$host = "localhost";
$port = "3306";
$user = "MYUSER";
$pw = "MYPASSWORD";
# DATA SOURCE NAME
$dsn = "dbi:mysql:$database:$host:$port";
# PERL DBI CONNECT
$connect = DBI->connect($dsn, $user, $pw);
fetch_db("MYTABLE");
sub fetch_db() {
my($table) = @_;
my $file = $table . ".txt";
open($FH, ">$file") or die("Can't open : $file $!\n");
print "테이블 $table\n";
print $FH "테이블 $table\n";
get_count($table);
print $FH "\n";
print "\n";
print $FH "---END--\n";
close $FH;
}
sub get_count() {
my($table) = @_;
# PREPARE THE QUERY
$query = "select TYPE, CAST(STORE_ID AS UNSIGNED INTEGER), count(*) from $table group by TYPE, CAST(STORE_ID AS UNSIGNED INTEGER)";
$query_handle = $connect->prepare($query);
# EXECUTE THE QUERY
$query_handle->execute();
# BIND TABLE COLUMNS TO VARIABLES
$query_handle->bind_columns(undef, \$id, \$type, \$cnt);
print "* 샵 별 건수\n";
print $FH "* 샵 별 건수\n";
# LOOP THROUGH RESULTS
print "TYPE\tSHOP_ID\tCNT\n";
print $FH "TYPE\tSHOP_ID\tCNT\n";
print "-------\t----\t---\n";
print $FH "-------\t----\t---\n";
while($query_handle->fetch()) {
print "$id\t$type\t$cnt\n";
print $FH "$id\t$type\t$cnt\n";
}
}
alter table MYTABLE add primary key ( MYID );
alter table MYTABLE add index MYCOL ( MYCOL );
show index from MYTABLE;
참고: http://www.webmadang.net/database/database.do?action=read&boardid=4003&page=2&seq=10
출처:http://stackoverflow.com/questions/1887964/duplicate-entire-mysql-database
CREATE DATABASE duplicateddb;
mysqldump -u admin -p originaldb | mysql -u backup -pPassword duplicateddb;