C:\Users\Administrator>cd /d D:\SOFT_PHP_PACKAGE\mysql5.6\bin
D:\SOFT_PHP_PACKAGE\mysql5.6\bin>mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.6.28 MySQL Community Server (GPL)
Copyright (c) 2000, 2015, 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> use mysql
Database changed
mysql> SHOW TABLES
->
-> use mysql
->
-> SHOW TABLES;
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 'use m
ysql
SHOW TABLES' at line 3
mysql> select host,user,password from mysql.user
-> ;
+-----------+---------------+-------------------------------------------+
| host | user | password |
+-----------+---------------+-------------------------------------------+
| localhost | root | *A8E9DF11CF62C9617F252C39F8D99DA9526ADF97 |
| 127.0.0.1 | root | *A8E9DF11CF62C9617F252C39F8D99DA9526ADF97 |
| % | xxxxxxxx | *A2F82D5DE05AFAF7DE8855199890C764C5D28681 |
| % | xxxxxxx | *65327D9F12D9C8B9B8CBCFCC744E5EF8430DDA0B |
| % | xxx | *EBEAE1FA884C705F0FE2821B9B03AE752869D6AA |
| % | xxxxx | *437D4FA85061C3D8877D546AED76449E3797ECD1 |
| % | xxxxxx | *48E6FFA7A9ADF3C2649CBE7F6C788A4B1905095E |
| % | xxxxxxxxxxxxx | *EB89BE5409BE261FC028F552C0263690E11540BD |
| % | xxxxxxxxxxxxx | *1D362542A682796CCEA903EC42CE7D7C6D9AE858 |
| % | xxxxxxxxx | *C3C51C68D56D2A2EED404970D133261CDEC83577 |
| % | xxxxxx | *CF31228949E6FAF7DD923FA99B0E9BA6D4FD9D3C |
| % | xxxxxx | *505F9C63916F2156CB5AE00BA95DC5644062D2B4 |
| % | xxxxxx | *4AD34F7689AFF7A2ED97FD00F171CD027A9B0639 |
| % | xxxxxxxxxxxx | *3C89AA0F78AB038A52CCB77C4E6374BB09B83039 |
| % | xxxxxxxxxx | *ED41FF5BD43DC9B4593C6AAFB5180B46D16CDBF6 |
| % | xxxx | *F869FE12384C5DFE0ACB00C7C6653BD112E6F557 |
| % | xxx | *D552A12F307FB7DA7A46E1D0BCE32A7A19B7B1CA |
| % | xxx | *25DA0348D56F13EB8F499CA3ADF72AEC3DD2E446 |
| % | xxxxxxxx | *EBA68E41FDC96C95F0ABE2FFDB7DD6CBA0BAAD5F |
+-----------+---------------+-------------------------------------------+
19 rows in set (0.04 sec)
mysql>
补充说明!!!
转自https://blog.csdn.net/zcczero/article/details/88683543
我登录数据库的时候是依据上面的教程,由于某些原因不敢直接修改root密码,所以先查看的,查看完了之后心凉了
我用的是mysql5.6,后期发现这时候其实可以直接建个数据库了
用navicat登root用户,建了一个数据库,然后给他建一个新用户给一个权限
mysql> CREATE USER `xxxx`@`%` IDENTIFIED BY 'xxxx888';
ERROR 1290 (HY000): The MySQL server is running with the --skip-grant-tables opt
ion so it cannot execute this statement
又报错,执行下面这句mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)
这就可以了mysql> CREATE USER `daorun`@`%` IDENTIFIED BY 'daorun888';
Query OK, 0 rows affected (0.00 sec)
mysql> GRANT Alter, Alter Routine, Create, Create Routine, Create Temporary Tabl
es, Create View, Delete, Drop, Event, Execute, Grant Option, Index, Insert, Lock
Tables, References, Select, Show View, Trigger, Update ON `daorun`.* TO `daorun
`@`%`;
Query OK, 0 rows affected (0.00 sec)
发表评论 取消回复