How To Install MySQL on Ubuntu 22.04
sudo apt install mysql-server
mysql_secure_installation
Output ... Failed! Error: SET PASSWORD has no significance for user 'root'@'localhost' as the authentication method used doesn't store authentication data in the MySQL server. Please consider using ALTER USER instead if you want to change authentication parameters. New password: First, open up the MySQL prompt:
sudo mysql
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password';
exit First, open up the MySQL prompt:
ALTER USER 'root'@'localhost' IDENTIFIED WITH auth_socket;
sudo mysql_secure_installation
sudo mysql mysql -u root -p
CREATE USER 'sammy'@'localhost' IDENTIFIED BY 'password';
grant all privileges on bbsdb.* to bbs@localhost with grant option;
FLUSH PRIVILEGES;
评论