sudo cp mysql-5.6.17-linux-glibc2.5-i686 /usr/local/mysql -r
四: 创建mysql用户组和用户执行命令:ps -ef|grep mysql 看到mysql服务说明启动成功 大功告成!
只显示这两个数据库,看不到mysql数据库是由于权限问题
只显示这两个数据库,看不到mysql数据库是由于权限问题information_schematest解决办法如下:
1 关闭mysql,执行命令: sudo service mysqld stop2 在mysql安装目录下修改my.cnf文件添加一行(跳过mysql权限控制): mysqld_safe --skip-grant-tables3 再打开另一个终端窗口,进行mysql操作,执行命令命令: mysql4 就可以看得mysql数据库了: 执行sql命令 use databases;5 执行sql命令,先删除原来的localhost, 执行sql 命令: delete from user where host='localhost';
6 再插入新的localhost记录: 执行sql命令:
INSERT INTO `user` (`Host`, `User`, `Password`, `Select_priv`, `Insert_priv`, `Update_priv`, `Delete_priv`, `Create_priv`, `Drop_priv`, `Reload_priv`, `Shutdown_priv`, `Process_priv`, `File_priv`, `Grant_priv`, `References_priv`, `Index_priv`, `Alter_priv`, `Show_db_priv`, `Super_priv`, `Create_tmp_table_priv`, `Lock_tables_priv`, `Execute_priv`, `Repl_slave_priv`, `Repl_client_priv`, `Create_view_priv`, `Show_view_priv`, `Create_routine_priv`, `Alter_routine_priv`, `Create_user_priv`, `Event_priv`, `Trigger_priv`, `Create_tablespace_priv`, `ssl_type`, `ssl_cipher`, `x509_issuer`, `x509_subject`, `max_questions`, `max_updates`, `max_connections`, `max_user_connections`, `plugin`, `authentication_string`, `password_expired`)
VALUES
('%','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0,'','','N'),
('127.0.0.1','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0,'','','N'),
('::1','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0,'','','N'),
('localhost','','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0,'','','N');
此命令sql的字典值与每个mysql版本有关, 请做相应修改, 我就在后面只管补0, 与user表字段数量一致。7 在第一个终端窗口把 mysql_safe ---skip-grant-tables注释掉, 重新启动mysql服务即可
win7 mysql绿色版请参照 http://www.cnblogs.com/zhtzyh2012/p/5305736.html