在Debian系统上配置LAMP环境中的MySQL,通常涉及以下步骤:
sudo apt update
sudo apt install mysql-server
mysqladmin -u root -p version
sudo mysql_secure_installation
sudo systemctl start mysql
sudo systemctl status mysql
/etc/mysql/mysql.conf.d/mysqld.cnf
。可以根据需要修改此文件,例如修改 bind-address
来允许远程访问,或者修改字符集等。CREATE USER 'new_user'@'localhost' IDENTIFIED BY 'new_password';
GRANT ALL PRIVILEGES ON *.* TO 'new_user'@'localhost' IDENTIFIED BY 'new_password';
FLUSH PRIVILEGES;