yum localinstall -y mysql-community*.rpm
报错:
Error: Package: 2:postfix-2.6.6-6.el6_7.1.x86_64 (localyum)
Requires: libmysqlclient.so.16(libmysqlclient_16)(64bit)
Removing: mysql-libs-5.1.71-1.el6.x86_64 (@anaconda-CentOS-201311272149.x86_64/6.5)
libmysqlclient.so.16(libmysqlclient_16)(64bit)
Obsoleted By: mysql-community-libs-5.7.15-1.el6.x86_64 (/mysql-community-libs-5.7.15-1.el6.x86_64)
Not found
Updated By: mysql-libs-5.1.73-7.el6.x86_64 (localyum)
libmysqlclient.so.16(libmysqlclient_16)(64bit)
Error: Package: 2:postfix-2.6.6-6.el6_7.1.x86_64 (localyum)
Requires: libmysqlclient.so.16()(64bit)
Removing: mysql-libs-5.1.71-1.el6.x86_64 (@anaconda-CentOS-201311272149.x86_64/6.5)
libmysqlclient.so.16()(64bit)
Obsoleted By: mysql-community-libs-5.7.15-1.el6.x86_64 (/mysql-community-libs-5.7.15-1.el6.x86_64)
Not found
Updated By: mysql-libs-5.1.73-7.el6.x86_64 (localyum)
libmysqlclient.so.16()(64bit)
You could try using --skip-broken to work around the problem
You could try running: rpm -Va --nofiles --nodigest
1)默认 root 密码为空,其实不为空,使用 mysql -u root -p 进行登录失败
2)mysql_secure_installation这个初始化也不行
直接编辑mysql配置文件
vim /etc/my.cnf
加入
skip-grant-tables
注意:要加在[mysqld]的位置
重启数据库
#进入 mysql控制台
# mysql
可能的报错:
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (111)
解决办法:加上-h127.0.0.1
[root@node2 bin]# mysql -h127.0.0.1 -uroot -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 3
Server version: 5.7.15 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> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
| sys |
+--------------------+
4 rows in set (0.13 sec)
>use mysql;
# 修改密码
>update user set authentication_string = password('yourpasswd'), password_expired = 'N', password_last_changed = now() where user = 'root';
删掉skip-grant-tables,再次重启即可
添加用户时,报错,是因为密码策略的问题,我们只是测试,密码不需要那么复杂
mysql> grant all privileges on test.* to jack@'%' identified by "test";
ERROR 1819 (HY000): Your password does not satisfy the current policy requirements
修改密码策略即可
mysql> set global validate_password_policy=0;
mysql5.7开发环境的配置示例:
[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
max_connections=1024
# Disabling symbolic-links is recommended to prevent assorted security risks
mysql> show databases;
ERROR 1820 (HY000): You must SET PASSWORD before executing this statement
mysql> use mysql;
ERROR 1820 (HY000): You must SET PASSWORD before executing this statement
报错:
# rpm -ivh MySQL-server-5.6.34-1.el6.x86_64.rpm
warning: MySQL-server-5.6.34-1.el6.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY
error: Failed dependencies:
libnuma.so.1()(64bit) is needed by MySQL-server-5.6.34-1.el6.x86_64
libnuma.so.1(libnuma_1.1)(64bit) is needed by MySQL-server-5.6.34-1.el6.x86_64
libnuma.so.1(libnuma_1.2)(64bit) is needed by MySQL-server-5.6.34-1.el6.x86_64