--------------------------------
初始密码:
#vim /var/log/mysqld.log
A temporary password is generated for root:默认生成初始密码
--------------------------------
免密设置
#vim /etc/my.cnf
skip-grant-tables
--------------------
需要手动增加可以远程访问数据库的用户。
方法一、本地登入mysql,更改 "mysql" 数据库里的 "user" 表里的 "host" 项,将"localhost"改为"%"
#mysql -u root -proot
mysql>use mysql; mysql>update user set host = '%' where user = 'root'; mysql>select host, user from user;mysql>FLUSH PRIVILEGES ;
方法二、直接授权(推荐)从任何主机上使用root用户,密码:youpassword(你的root密码)连接到mysql服务器:
# mysql -u root -proot
mysql>GRANT ALL PRIVILEGES ON *.* TO IDENTIFIED BY 'youpassword' WITH GRANT OPTION;mysql>FLUSH PRIVILEGES ;
操作完后切记执行以下命令刷新权限
FLUSH PRIVILEGES
----------------------------
http://www.cnblogs.com/ivictor/p/5142809.html
-----------------------------
修改密码
http://www.cnblogs.com/jyginger/archive/2011/04/27/2030017.html
--------------------
too many connections
1)临时修改
MariaDB [(none)]> show variables like "max_connections"; +-----------------+-------+ | Variable_name | Value | +-----------------+-------+ | max_connections | 214 | +-----------------+-------+ 1 row in set (0.00 sec) MariaDB [(none)]> set GLOBAL max_connections=1000; Query OK, 0 rows affected (0.00 sec) MariaDB [(none)]> show variables like "max_connections"; +-----------------+-------+ | Variable_name | Value | +-----------------+-------+ | max_connections | 1000 | +-----------------+-------+ 1 row in set (0.00 sec)
====
2018-05-05
ALTER USER 'root'@'localhost' IDENTIFIED BY 'root123';
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'root123';