In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-29 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
MySQL is a relational database management system that stores data in different tables rather than storing all data in one large repository, which increases speed and flexibility.
MySQL uses SQL, the most commonly standardized language for accessing databases. MySQL software uses a dual licensing policy, divided into community version and commercial version, because of its small size, speed, low total cost of ownership, especially open source this feature, generally small and medium-sized website development choose MySQL as a website database.
1. Forget MySQL 5.7 root password solution 1 (recommended):[root@mysql ~]# systemctl stop mysqld #Stop MySQL service [root@mysql ~]# mysqld --user=root --skip-grant-tables #Use mysqld command to start mysql service, skip authorization table #After the above command is executed, it will occupy the current terminal all the time. You need to start another terminal.#Don't think about running it in the background. Put it in the background. Port 3306 will not listen.[root@mysql ~]# ss -anpt| grep 3306 #Turn on another terminal and make sure the port is listening to LISTEN 0 80 :::3306 :::* users:(("mysqld",pid=8282,fd=33))[root@mysql ~]# mysql -uroot #Log in as root without password mysql> update mysql.user set authentication_string=password ('1234 ') -> where User='root' and Host='localhost'; #Change root password to "1234"mysql> flush privileges; #refresh permissions [root@mysql ~]# kill 8282 #Kill the terminal process number occupied by mysqld when it was started before. Do not use the-9 option [root@mysql ~]# systemctl start mysqld #Start MySQL service, log in with new password
If in the above process, use kill -9 to end the terminal occupied by mysqld, then start again may report an error, sock file is locked, at this time, you need to delete your mysql sock file, I here sock file in/tmp, respectively, mysql.sock.lock and mysql.sock these two files, delete and start MySQL again.
Method 2:[root@mysql01 ~]# mysql --version #Determine MySQL version mysql Ver 14.14 Distrib 5.7.28, for linux-glibc2.12 (x86_64) using EditLine wrapper[root@mysql01 ~]# vim /etc/my.cnf #Edit master profile [mysqld] #Write skip-grant-tables below mysqld line .................# [root@mysql01 ~]# systemctl restart mysqld #Restart MySQL service to make configuration file take effect [root@mysql01 ~]# mysql -uroot #Skip password verification and log in directly #Change root password to pwd@123 and refresh privileges mysql> use mysql;mysql> update user set authentication_string = passwoord ('pwd@123') where user = 'root'; mysql> flush privileges; #refresh permissions mysql> exit#configure password authentication, log in with new password [root@mysql01 ~]# vim /etc/my.cnf #Edit master profile [mysqld] skip-grant-tables #delete this line [root@mysql01 ~]# systemctl restart mysqld #Restart to make changes effective #Log in successfully with new password [root@mysql01 ~]# mysql -uroot -ppwd@123 2, Forget MySQL 8.0 database root password solution [root@mysql01 ~]# mysql --version #View MySQL version mysql Ver 8.0.18 for linux-glibc2.12 on x86_64 (MySQL Community Server - GPL)[root@mysql01 ~]# vim /etc/my.cnf #Edit master profile [mysqld] #Write skip-grant-tables below mysqld line .................# [root@mysql01 ~]# systemctl restart mysqld #Restart MySQL service to make configuration file take effect [root@mysql01 ~]# mysql -uroot #Skip password verification and log in to database #Set root password to null mysql> use mysql> update user set authentication_string =''where user ='root ';mysql> flush privileges;mysql> exit#Turn on password verification and log in to database again [root@mysql01 ~]# vim /etc/my.cnf #Edit master profile [mysqld] skip-grant-tables #delete this line [root@mysql01 ~]# systemctl restart mysqld #Restart to make changes take effect [root@mysql01 ~]# mysql -uroot #login database mysql> alter user root@localhost identified by 'pwd@111';mysql> flush privileges;mysql> exit#login test with new password [root@mysql01 ~]# mysql -uroot -ppwd@111
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 217
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.