CentOS6.5离线安装mysql遇到的几个问题
来源:互联网 发布:linux如何安装bind 编辑:程序博客网 时间:2024/05/17 03:08
[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/mysqlmysql -u root mysqlReading table information for completion of table and column namesYou can turn off this feature to get a quicker startup with -AWelcome to the MySQL monitor. Commands end with ; or \g.Your MySQL connection id is 1Server 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 itsaffiliates. Other names may be trademarks of their respectiveowners.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 1mysql> update user set password=PASSWORD('guo') where USER='root';Query OK, 4 rows affected (0.00 sec)Rows matched: 4 Changed: 4 Warnings: 0mysql> flush privileges;Query OK, 0 rows affected (0.00 sec)mysql> quit;Bye[root@ws1m mysql]# mysql -uroot -pEnter password: Welcome to the MySQL monitor. Commands end with ; or \g.Your MySQL connection id is 2Server version: 5.6.31Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.Oracle is a registered trademark of Oracle Corporation and/or itsaffiliates. Other names may be trademarks of their respectiveowners.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 statementmysql> 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.00 sec)mysql> flush privileges;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 restartShutting 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: 0mysql> flush privileges;Query OK, 0 rows affected (0.00 sec)mysql> quit;Bye#先测试下以ws1m 远程连接行不行[root@ws1m ~]# mysql -h ws1m -u root -p
0 0
- CentOS6.5离线安装mysql遇到的几个问题
- Centos6.5离线配置CDH5.1心得和遇到的问题(已安装成功)
- 在centos6.5下安装MySQL遇到的些许问题
- 安装cucumber遇到的几个问题
- 安装微擎时遇到的几个问题
- pyviz安装遇到的几个问题
- centos6.5离线安装gcc
- centos6安装mysql(离线与在线)
- Centos6.4搭建Redis集群遇到的几个问题汇总
- Hibernate连接MySql遇到的几个问题
- VS2015连接mysql遇到的几个问题
- RAC安装与维护遇到的几个问题
- vs2010 安装windows phone 遇到的几个问题
- matlab安装中遇到的几个问题
- TUXEDO安装调试遇到的几个问题
- 安装oracle11g学习版遇到的几个问题
- 安装memcached中遇到的几个问题
- Ubuntu安装完成后遇到的几个问题
- python技巧(3)--python cookbook学习笔记
- jquery表格获取行、列
- Linux常用命令
- 二进制 十进制数的转换
- FragmentTabHost切换Fragment时避免重复加载UI
- CentOS6.5离线安装mysql遇到的几个问题
- Leetcode 93 Restore IP Addresses
- Android实战——改造PullToRefresh下拉刷新和上拉加载
- openwrt hotplug
- 深剖VR,AR和MR三者之间关系
- 如何编写你自己的 Virtual DOM
- Chrome调试前端页面的若干技巧
- 单链表的实现(部分)
- CTF之常见的加密