Home PC Games Linux Windows Database Network Programming Server Mobile  
           
  Home \ Database \ MySQL 5.7 can not log in problem     - Detailed PHP code optimization [section] (explain reasons) (Programming)

- Django 1.8 TEMPLATE_DIRS configuration and STATICFILES_DIRS (Server)

- Linux scheduling summary (Linux)

- Zabbix installation under Linux (Server)

- Experience PHP 7.0 on CentOS 7.x / Fedora 21 (Server)

- Locale files under Ubuntu (Linux)

- Keepalived achieve high availability Nginx Reverse Proxy (Server)

- Use CutyCapt to convert HTML pages to png images on Linux (Linux)

- Android annotation support (Support Annotations) (Programming)

- MySQL5.7 JSON type using presentation (Database)

- VMware Workstation virtual machine startup error: Could not open / dev / vmmon in CentOS 6 (Linux)

- MySQL root password reset under CentOS (Database)

- RedHat yum configuration and the prompt (Linux)

- Installation and operation GAMIT software under Linux operating system (Linux)

- Java regular expressions examples (Programming)

- How to Use Nmap security scanner tool on Linux (Linux)

- GoldenGate for Oracle data consistency initializing (Database)

- Processor in protected mode of protection (Linux)

- innodb storage engine backup tool --Xtrabackup (Database)

- Use custom backup plans for Debian backupninja (Linux)

 
         
  MySQL 5.7 can not log in problem
     
  Add Date : 2016-07-09      
         
         
         
  In the first out to the MySQL 5.7 version, let the manager with the latest version build LNMP, build process encountered many problems, today to talk about MySQL a brief question:

After installation is complete, you can not log in mysql, presumably after the new installation is the default root user login and password should be empty, so you can directly enter, but there were questions below

[Root @ bogon mysql] # bin / mysql
ERROR 1045 (28000): Access denied for user 'root' @ 'localhost' (using password: NO)

[Root @ bogon mysql] # bin / mysqladmin -uroot password
mysqladmin: connect to server at 'localhost' failed
error: 'Access denied for user' root '@' localhost '(using password: NO)'

At this point my reaction would not for security reasons, the new mysql default password, I check it really is, there will be installed by default mysql password generation, password files directly written in the log-error log file (in version 5.6 is on the root / .mysql_secret file, more subtle, unfamiliar words may be at a loss), but I went to look at the log_error, but did not find the password, and there is no root / .mysql_secret file;

Then I try to add a skip-grant-tables in the configuration file, then restart can go in; so it must be the password problem, so I started to change the password

mysql> update user set password = password ( '123456') where user = 'root';
ERROR 1054 (42S22): Unknown column 'password' in 'field list'
mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)
mysql> update user set password = password ( '123456') where user = 'root';
ERROR 1054 (42S22): Unknown column 'password' in 'field list'

But there is such a situation, not change, the Internet, he said: the official way, whether I use the --skip-grant-tables are mysql start test fails, parents can test:
shell> mysql -uroot -p'password '#password in the password that is .mysql_secret
mysql> SET PASSWORD = PASSWORD ( 'newpasswd');

However, according to the above operation, the official explanation is not too tricky. . . . . . . . .

So I began to search for a variety of solutions, and the help of friends, finally found a solution -----------------------

We root @ localhost user deleted, and then there is this new user

mysql> delete from mysql.user where user = 'root' and host = 'localhost';
Query OK, 1 row affected (0.01 sec)
mysql> select user, host from mysql.user;
+ ----------- + ----------- +
| User | host |
+ ----------- + ----------- +
| Mysql.sys | localhost |
+ ----------- + ----------- +
1 row in set (0.00 sec)
mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)
. Mysql> grant all on * * to 'root' @ 'localhost' identified by '123456';
Query OK, 0 rows affected, 1 warning (0.00 sec)
mysql> select user, host from mysql.user;
+ ----------- + ----------- +
| User | host |
+ ----------- + ----------- +
| Mysql.sys | localhost |
| Root | localhost |
+ ----------- + ----------- +
2 rows in set (0.01 sec)

But this still does not work, you use the following command will find a situation

mysql> select * from mysql.user \ G;

Grant display N - mysql privileges architecture system (should say) is closed, so .............

. Mysql> grant all on * * to 'root' @ 'localhost' identified by '123456' with grant option;
Query OK, 0 rows affected, 1 warning (0.00 sec)
mysql> flush privileges;
Query OK, 0 rows affected (0.01 sec)

Exit mysql, the skip-grant-tables Note out, and then restart mysql. At this time landing on it.

Of course, many friends told me only fault may be similar, but not identical, if the above method does not work, you can leave a message to me, we can discuss.

Of course, I'm not too familiar mysql also, I want to delete a user, if there is data inside how to do, in fact, look like a backup just in case; and my friend told me actually remove users and new users do not affect the data, all right because I do not practice, it is difficult to guarantee, in fact, look better and more secure backup, does not affect the data that is better for our friends.
     
         
         
         
  More:      
 
- Use the Find command to help you find those files that need to be cleaned (Linux)
- MySQL query performance comparison of a single truth (Database)
- Linux rights management (Linux)
- How to set cache valid time in Apache (Server)
- The user of fedora is not in the sudoers file method to solve (Linux)
- CentOS 6 Install Linux kernel source (Linux)
- JVM garbage collector and memory allocation strategy (Programming)
- Docker improve safety (Server)
- Quick Install software RAID on Linux (Linux)
- Vi syntax highlighting settings (Linux)
- After installing minimize RHEL / CentOS 7 need to do some things (Linux)
- The most simple drive to write and test procedures under linux (Programming)
- Linux serial port driver test (Linux)
- Installation of Python2.7.8 and iPython under CentOS6.5 (Linux)
- Java in the inverter and covariance (Programming)
- How to contribute code on GitHub uploads (Linux)
- Linux - EXT2 file system is described in detail (Linux)
- The sublime into IDE (Linux)
- Android code performance optimization tips (Programming)
- GCC library link order problems (Programming)
     
           
     
  CopyRight 2002-2020 newfreesoft.com, All Rights Reserved.