官网mysql 下载地址mysql
安装过程 省去sql
安装好以后 下载navicat数据库
连接 遇到 mysql 2003 - Can't connect to MySQL server 错误,安全
重启mysql 服务
#错误2 ERROR 1045: Access denied for user: 'root@localhost' 处理方法。session
##解决方案ui
以安全模式进入数据库 cd /usr/local/mysql/binthis
sudo su.net
而后即可以看到终端命令变成这个开头: sh-3.2# 输入一下命令:code
sh-3.2# ./mysqld_safe --skip-grant-tables &orm
以后即可以以安全模式进入数据库了。
另外一个终端
Last login: Sat Dec 15 22:24:07 on ttys000 xiaofengsedeMacBook-Pro:~ xiaofengse$ mysql -u -root Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 7 Server version: 8.0.13 MySQL Community Server - GPL
Copyright (c) 2000, 2018, 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> select host,user,authentication_string from mysql.user; +-----------+------------------+------------------------------------------------------------------------+ | host | user | authentication_string | +-----------+------------------+------------------------------------------------------------------------+ | localhost | mysql.infoschema | $A$005$THISISACOMBINATIONOFINVALIDSALTANDPASSWORDTHATMUSTNEVERBRBEUSED | | localhost | mysql.session | $A$005$THISISACOMBINATIONOFINVALIDSALTANDPASSWORDTHATMUSTNEVERBRBEUSED | | localhost | mysql.sys | $A$005$THISISACOMBINATIONOFINVALIDSALTANDPASSWORDTHATMUSTNEVERBRBEUSED | | localhost | root | $A$005$d_3&v_9% TNs692QhsNBvjzKDBaPxZKej3SO68XvGEcnKTeDMVWA | 8Ree*% +-----------+------------------+------------------------------------------------------------------------+ 4 rows in set (0.00 sec)
mysql> user mysql; 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 'user mysql' at line 1 mysql> update user set authentication_string='' where user='root'; ERROR 1046 (3D000): No database selected mysql> use mysql; Reading table information for completion of table and column names You can turn off this feature to get a quicker startup with -A
Database changed mysql> update user set authentication_string='' where user='root'; Query OK, 1 row affected (0.03 sec) Rows matched: 1 Changed: 1 Warnings: 0
mysql> ALTER user 'root'@'localhost' IDENTIFIED BY 'Root123#'; ERROR 1290 (HY000): The MySQL server is running with the --skip-grant-tables option so it cannot execute this statement mysql> ALTER user 'root'@'localhost' IDENTIFIED BY 'Root123#'; ERROR 1290 (HY000): The MySQL server is running with the --skip-grant-tables option so it cannot execute this statement mysql> mysql> flush privileges -> ; Query OK, 0 rows affected (0.00 sec)
mysql> ALTER user 'root'@'localhost' IDENTIFIED BY 'Root123#'; Query OK, 0 rows affected (0.07 sec)
mysql> flush privileges; Query OK, 0 rows affected (0.00 sec)
mysql> ALTER user 'root'@'localhost' IDENTIFIED BY 'root'; Query OK, 0 rows affected (0.07 sec)
mysql> flush privileges; Query OK, 0 rows affected (0.00 sec)
mysql>