MYSQL 笔记
添加用户 insert into mysql.user(Host,User,Password) values('localhost','admin',password('1234')); 添加权限 mysql> GRANT ALL PRIVILEGES ON *.* TO admin@localhost IDENTIFIED BY 'password' WITH GRANT OPTION; mysql> GRANT ALL PRIVILEGES ON *.* TO admin@"%" IDENTIFIED BY 'password' WITH GRANT OPTION; mysql> GRANT RELOAD,PROCESS ON *.* TO admin@localhost; mysql> GRANT USAGE ON *.* TO admin@localhost; mysql> grant select,insert,update,delete,create,drop on vtdc.employee to admin@10.163.225.87 identified by ‘password′; 刷新系统权限表 mysql>flush privileges; //重载mysql数据 show engines; 查看mysql 的数据库引擎 表修复 REPAIR TABLE `表名`; 导出数据库 /mysqldump --no-data=true -uroot -proot -S /tmp/mysql01.sock -P 3306 operation > /tmp/123.sql 非压缩备份文件恢复: mysql -u root -p dataname < name2008010103.sql 从压缩文件直接恢复: gzip < name2008010103.sql.gz | mysql -u root -p password 或: zcat name2008010103.sql.gz | mysql -u root -p password