海外主机测评

您现在的位置是:首页 > 国外服务器 > 正文

国外服务器

CentOS6.5离线安装mysql遇到的几个问题

cds8202023-02-22国外服务器119
本站教程收集整理的这篇文章主要介绍了CentOS6.5离线安装mysql遇到的几个问题,本站教程本站觉得挺不错的,现在分享给大家,也给大家做个参考。

本站教程收集整理的这篇文章主要介绍了CentOS6.5离线安装mysql遇到的几个问题,本站教程本站觉得挺不错的,现在分享给大家,也给大家做个参考。
[root@ws1m MysqL]# rpm -ivh MysqL-server-5.6.31-1.el6.x86_64.rpm MysqL-client-5.6.31-1.el6.x86_64.rpm MysqL-devel-5.6.31-1.el6.x86_64.rpm #先下载好这三个rpm包拷到服务器直接装

#装完不知道root密码
[root@ws1m MysqL]# /etc/init.d/MysqLd stop #如果MysqL启动了,也先关闭。
ShutTing down Mysql..                                      [确定]
[root@ws1m MysqL]# MysqLd_safe --user=MysqL --skip-grant-tables --skip-networking &
[1] 10185
[root@ws1m MysqL]# 160930 03:50:30 MysqLd_safe Logging to '/var/lib/MysqL/ws1m.err'.
160930 03:50:30 MysqLd_safe StarTing MysqLd daemon with databases from /var/lib/MysqL
MysqL -u root MysqL
Reading table informatiON for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Welcome to the MysqL monitor.  Commands end with ; or \g.
Your MysqL connection id is 1
Server version: 5.6.31 MysqL Community Server (GPL)

Copyright (C) 2000,2016,Oracle and/or its affiliates. All rights reserved.

Oracle is a registered Trademark of Oracle Corporation and/or its
affiliates. Other names may be Trademarks of their respective
owners.

Type 'Help;' or '\h' for Help. Type '\c' to clear the current input statement.

MysqL> updatE user SET password=passworD('guo') where USER='root';
ERROR 1064 (42000): You have an error in your sql Syntax; check the manual that corresponds to your MysqL server version for the right Syntax to use near ''guo') where USER='root'' at line 1
MysqL> update user set password=passworD('guo') where USER='root';
Query OK,4 rows affected (0.00 seC)
Rows matched: 4  Changed: 4  Warnings: 0

MysqL> flush privileges;
Query OK,0 rows affected (0.00 seC)

MysqL> quit;
Bye
[root@ws1m MysqL]# MysqL -uroot -p
Enter password: 
Welcome to the MysqL monitor.  Commands end with ; or \g.
Your MysqL connection id is 2
Server version: 5.6.31

Copyright (C) 2000,Oracle and/or its affiliates. All rights reserved.

Oracle is a registered Trademark of Oracle Corporation and/or its
affiliates. Other names may be Trademarks of their respective
owners.

Type 'Help;' or '\h' for Help. Type '\c' to clear the current input statement.
MysqL> create database ambari  DEFAULT CHARSET utf8 COLLATE utf8_general_ci;
ERROR 1820 (HY000): You must SET passworD before execuTing this statement
MysqL> set password=password('guo');
Query OK,0 rows affected (0.00 seC)

MysqL> create database ambari  DEFAULT CHARSET utf8 COLLATE utf8_general_ci;
MysqL> grant all privileges on *.* to 'root'@'%' identified by 'guo' with grant option;
Query OK,0 rows affected (0.00 seC)

MysqL> flush privileges;
Query OK,0 rows affected (0.00 seC)

MysqL> grant all privileges on *.* to 'root'@'localhost' identified by 'guo' with grant option;
Query OK,0 rows affected (0.01 seC)

MysqL> quit;
Bye
#报错的原因有很多,一定要看日志。
ERROR: ExiTing with exit code 1. 
REASON: Database check Failed to complete. Please check /var/log/ambari-server/ambari-server.log and /var/log/ambari-server/ambari-server-check-database.log for more information.

#查看日志提示密码过时,修改密码
MysqL> use MysqL; 
MysqL> update user set password=password('guo') where user='root'; 
MysqL> 状态下输入 FLUSH PRIVILEGES; 
回显 
Query OK,0 rows affected (0.00 seC) 
MysqL> 状态下输入 quit 
#重启MysqL
[root@ws1m ~]# service MysqL restart
ShutTing down Mysql..                                      [确定]
StarTing Mysql.                                            [确定]

#把password_expired 改成不过期
MysqL> use MysqL;

MysqL> update user set password_expired='N' where User='root';
Query OK,3 rows affected (0.00 seC)
Rows matched: 5  Changed: 3  Warnings: 0

MysqL> flush privileges;
Query OK,0 rows affected (0.00 seC)

MysqL> quit;
Bye

#先测试下以ws1m 远程连接行不行
[root@ws1m ~]# MysqL -h ws1m -u root -p

本站总结

以上是本站教程为你收集整理的CentOS6.5离线安装mysql遇到的几个问题全部内容,希望文章能够帮你解决CentOS6.5离线安装mysql遇到的几个问题所遇到的程序开发问题。

如果觉得本站教程网站内容还不错,欢迎将本站教程推荐给好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。

《CentOS6.5离线安装mysql遇到的几个问题》来自互联网同行内容,若有侵权,请联系我们删除!

发表评论

评论列表

  • 这篇文章还没有收到评论,赶紧来抢沙发吧~