本文转自:http://www.duyaofei.com/mysql-%E5%91%BD%E4%BB%A4%E8%A1%8C%E5%B8%B8%E7%94%A8%E7%BB%B4%E6%8A%A4sql/ 不习惯用PHPMyAdmin,总是觉得这个东西会让别人很容易的就拿走我的数据,所以没用这个。但是维护真的很繁琐,所以整理日常使用的一些SQL。然后方便复制粘贴进ssh,嘎嘎。 一、MySql添加用户 GRANT ALL PRIVILEGES ON qizhao.* TO 用户名@’%’ IDENTIFIED BY ‘密码’ WITH GRANT OPTION; 二、删除用户 DELETE FROM user WHERE User=’user_name’ and Host=’host_name’; FLUSH PRIVILEGES; 三、MySql4与mysql5共存 启动mysql5 /usr/local/mysql/bin/mysqld –basedir=/usr/local/mysql5 –datadir=/usr/local/mysql5/data –user=mysql –socket=/tmp/mysql5.sock –port=3307 四、显示MySQL的建表语句 show create table tablename; alter table t add column name varchar(20) after age; show full processlist; –可以查看完整的执行sql; 五、安装MySQL 手动编译MySQL,强烈不建议采用,呵呵,升级起来麻烦。我一般会通过apt-get来安装。 ./configure –prefix=/usr/local/mysql –without-debug –without-bench –enable-thread-safe-client –ena......Read More>