Tag Archives: data

MySQL error — multiple methods of failed to find valid data directory and MySQL setting password appear

MYSQL error – Failed to find valid data directory

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

the MYSQL error, Failed to find valid data directory. _Nikita – _failed CSDN blog to find valid data directory.
https://blog.csdn.net/Hellen0708/article/details/93377724

=================================================================================

=================================================================================

=================================================================================

the mysql database password _qq_26486949 blog blog – CSDN _mysql password
https://blog.csdn.net/qq_26486949/article/details/88373487

mysql database password Settings

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.

format: mysql> Set password for username @localhost = password(‘ new password ‘);

example: mysql> set password for root@localhost = password(‘123’);

method 2: mysqladmin

format: mysqladmin-u username -p old password password new password

example: mysqladmin-uroot-p123456 password 123

method 3: edit user table

directly with UPDATE

log in to MySQL first.

mysql> use mysql;

mysql> update user set password=password(‘123′) where user=’root’ and host=’localhost’;

mysql> flush privileges;

method 4: use the GRANT statement mysql> Grant all on *.* to ‘root’@’localhost’ IDENTIFIED BY ‘your password ‘with grant option; mysql> flush privileges;

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.
2. Open a DOS window and go to mysql\bin directory.

3. Enter mysqld –skip-grant-tables enter. Skip-grant-tables means to skip permission table authentication when starting MySQL service.

4. Open another DOS window (because the DOS window is no longer active) and go to the mysql\bin directory.
5. Enter mysql enter. If successful, mysql prompt &gt will appear. .

6. Connection permission database: use mysql; .

. Update user set password=password(“123″) where user=”root”; Don’t forget to put a semicolon at the end.

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; .

8. Quit quit.
9. Log out of the system, enter again, log in with the username root and the new password 123 that you just set.

Node.js Using port 80 to report errors in Linux

node. js USES port 80 in Linux to report an error

Because the server USES CentOS8, the local environment is changed to Linux to facilitate development and deployment.

FATAL listen EACCES: Permission denied 0.0.0.0:80
the at Server setupListenHandle [as _listen2] (net. Js: 1296:21)
the at listenInCluster (net. Js: 1361:12)
the at doListen (net. Js: 1498:7)
the at processTicksAndRejections (internal/process/task_queues. Js: 85:21)
✖ Nuxt Fatal Error
Error: listen EACCES: permission denied 0.0.0.0:80
NPM ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! xxx dev: nuxt
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the xxx.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/xxx/.npm/_logs/xxx-debug.log

solution

initially suspected that port 80 was occupied, but when I checked the port information, I found that port 80 was not occupied, so I should have no permission to use port 80. The simple solution is to add sudo.

Replace NPM run devsudo NPM run dev