Home PC Games Linux Windows Database Network Programming Server Mobile  
           
  Home \ Database \ MySQL 5.7 can not log in problem     - Oracle 12C with multi-column index (Database)

- C # C ++ Java interface type conversion (Programming)

- Redmine Installation (Linux)

- rsync + inotify to achieve real-time synchronization (Server)

- A process of how to get the current traffic in GNU Linux (Linux)

- Nginx reverse proxy and self-signed https (Server)

- Create RAID 1 (mirroring) with two disks (Linux)

- How to configure security services under Linux (Linux)

- Getting Started with Java NIO (Programming)

- SendMail version of Java implementation with attachments (Programming)

- Oracle database on the hit rate of query summary (Database)

- Under CentOS Linux automatic backup MySQL database daily (Database)

- Apache Web Security Linux systems (Linux)

- React Native (Programming)

- CentOS yum install LNMP PHP5.4 version (Server)

- Ubuntu 14.10 / 14.04 how to install Quick Start tool Mutate 2.2 (Linux)

- Security implementation of disk data protection under Linux (Linux)

- Hadoop 2.2.0 installation development environment (standalone pseudo-distributed mode) (Server)

- Use Oracle Data Guard to complete cross-platform database migration cases (Database)

- HTTP and FTP TCP-FLOOD CC Attacks Analysis and Prevention solutions under CentOS 6.5 (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:      
 
- Encrypted with GnuPG signature to verify the authenticity and integrity of downloaded file (Linux)
- Understanding the Linux load average on other UNIX-Like systems (Linux)
- Ubuntu 14.04 LTS compiler installation R Source Code (Linux)
- The top command under Linux (Linux)
- PostgreSQL vacuum principle of a function and parameters (Database)
- Installation Elementary OS Freya 20 things to do (Linux)
- The Gitlab migrated to Docker container (Server)
- Reported too many open files Linux solutions (Server)
- count (*) function in MySQL optimization of InnoDB storage engine (Database)
- Ubuntu will be written in a command file, executable file, source command (Linux)
- Talk about the Linux folder permissions issue again (Linux)
- Ubuntu 12.04 64-bit installation Redmine + Git + ReviewBoard (Linux)
- Ten SCP transfer command example (Linux)
- How to disable IPv6 in the CentOS 7 (Linux)
- A brief description of Java 8 new features introduced syntax (Programming)
- Python2 ---- function using dictionaries (Programming)
- Linux disk partition, format, mount the directory (Linux)
- To install Python-Pip and Fabric under CentOS / Ubuntu (Linux)
- Oracle to use full-text indexing (Database)
- Linux systems for entry-learning - Install Go language in Linux (Linux)
     
           
     
  CopyRight 2002-2022 newfreesoft.com, All Rights Reserved.