CentOS6.4x64安装mysql5.6.23(rpm)
#查看已安装的的mysql
shell>rpm -qa|grep -i mysql
#根据上条命令的结果卸载mysql
shell>rpm -e -nodeps mysql*
#下载mysql的server和client
shell>cd /usr/local
shell>wget http://cdn.mysql.com/Downloads/MySQL-5.6/MySQL-server-5.6.23-1.el6.x86_64.rpm
shell>wget http://cdn.mysql.com/Downloads/MySQL-5.6/MySQL-client-5.6.23-1.el6.x86_64.rpm
#安装mysql
shell>rmp -ivh MySQL-server-5.6.23-1.el6.x86_64.rpm
shell>rpm -ivh MySQL-client-5.6.23-1.el6.x86_64.rpm
#重新启动mysql并用mysqladmin设置root密码
shell>service mysql restart
shell> mysqladmin -u root password "123456"
ps:
tnnd,到这步不行了,报错:
mysqladmin: connect to server at ‘localhost‘ failed
error: ‘Access denied for user ‘root‘@‘localhost‘ (using password: NO)‘
解决:
#先停止mysql服务
shell>service mysql stop;
#采用安全方式登录
shell>mysqld_safe --user=mysql --skip-grant-tables --skip-networking &
#然后输入命令mysql -u root mysql进去mysql提示符
mysql>update user set password=password(‘12345‘) where user=‘root‘;
mysql>flush privileges;
mysql>quit;
#重启mysql服务
shell>service mysql restart
#登录myesql
shell>mysql -uroot -p
尼玛装了3天的mysql终于貌似可以了,下一步写个jdbc连接下看看,先设置mysql允许远程登录:
#登录到mysql
shell>mysql -u root -p
#切换数据库
mysql>use mysql;
ps:晕,注意这里有肯提示你设置密码,那就设置一下好了
mysql>set password=password(‘123456‘);
#更改表:
mysql>update user set host=‘%‘ where host=‘localhsot‘;
mysql>quit;
#重启mysql
shell>service mysql restart;
ps:然后再一台windws机子是telnet了一下,即在cmd窗口中运行:telnet 192.168.100.240 3306,o了!!!
郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。