p>
p>
p>
p>
MYSQL error – Failed to find valid data directory
p>
operating environment: windows10
database version: mysql.8.0.16
problem description:
MySQL service is starting.
MySQL service cannot start. The
service did not report any errors.
solution:
- manually empty the files in the data folder under the installation path (possibly due to incomplete files due to previous initialization failure)
- into the bin path remove mysql service
- under the bin path enter mysqld –initialize-insecure (the program will create many files under the data folder)
- continue to enter mysqld -install (service has been reinstalled)
- start mysql service, enter net start mysql
p>
p>
the MYSQL error, Failed to find valid data directory. _Nikita – _failed CSDN blog to find valid data directory. p>
https://blog.csdn.net/Hellen0708/article/details/93377724
p>
p>
p>
=================================================================================
=================================================================================
=================================================================================
p>
the mysql database password _qq_26486949 blog blog – CSDN _mysql password p>
https://blog.csdn.net/qq_26486949/article/details/88373487
p>
p>
mysql database password Settings
p>
p>
p>
mysql newly installed does not have a password by default, so it needs to be set manually.
method 1: use the SET PASSWORD command
log in to MySQL first. p>
format: mysql> Set password for username @localhost = password(‘ new password ‘); p>
example: mysql> set password for root@localhost = password(‘123’); p>
p>
method 2: mysqladmin
format: mysqladmin-u username -p old password password new password
example: mysqladmin-uroot-p123456 password 123
p>
method 3: edit user table
directly with UPDATE
log in to MySQL first. p>
mysql> use mysql; p>
mysql> update user set password=password(‘123′) where user=’root’ and host=’localhost’; p>
mysql> flush privileges;
p>
method 4: use the GRANT statement mysql> Grant all on *.* to ‘root’@’localhost’ IDENTIFIED BY ‘your password ‘with grant option; mysql> flush privileges;
p>
method 5: when you forget the root password or initialize the password, you can do this:
Take Windows as an example:
1. Close the running MySQL service. p>
2. Open a DOS window and go to mysql\bin directory. p>
3. Enter mysqld –skip-grant-tables enter. Skip-grant-tables means to skip permission table authentication when starting MySQL service. p>
4. Open another DOS window (because the DOS window is no longer active) and go to the mysql\bin directory. p>
5. Enter mysql enter. If successful, mysql prompt > will appear. . p>
6. Connection permission database: use mysql; . p>
. Update user set password=password(“123″) where user=”root”; Don’t forget to put a semicolon at the end. p>
if ERROR 1054(42S22) Unknown column ‘password’ in ‘field list’ occurs, this is because the password field is no longer available in mysql database in version 5.7, and the password field is changed to authentication_string. The statement should be update User Set Authentication_string =password(“123″) where user=”root”;
7. Flush privileges (mandatory step) : flush privileges; . p>
8. Quit quit. p>
9. Log out of the system, enter again, log in with the username root and the new password 123 that you just set.
p>
p>