mysql杂记
导入备份的sql文件
use mydb;
source /var/www/data.sql;
导入txt数据
LOAD DATA INFILE 'path/to/file.txt'
INTO TABLE `tablename`
FIELDS TERMINATED BY ',';
时间戳和标准时间的转换
#时间戳 to 标准时间
FROM_UNIXTIME(xxxxxxxxxx);
#标准时间 to 时间戳
UNIX_TIMESTAMP('YYYY-MM-DD HH:MM:SS'');
Error: Cannot load from mysql.proc. The table is probably corrupted
mysql_upgrade -uroot -p