sudo mysqladmin -u root password newpassword 卸载MySQL:sudo apt-get autoremove –purge mysql-server-5.0 sudo apt-get remove mysql-server sudo apt-get autoremove mysql-server sudo apt-get remove mysql-common 执行以下命令清理残留数据:dpkg -l |grep ^rc|awk '{print $2}' |sudo ...
Ubuntu安装和卸载MYSQL
安装MySQL在Ubuntu上,需执行以下命令:
sudo apt-get install mysql-server
sudo apt-get install mysql-client
sudo apt-get install php5-mysql
完成安装后,MySQL服务器应自动启动。通过运行命令:
sudo netstat -tap | grep mysql
检查服务器状态,应显示类似行:
tcp 0 0 localhost.localdomain:mysql *:* LISTEN -
若服务未运行,使用以下命令启动:
sudo /etc/init.d/mysql restart
登录MySQL:
$mysql -uroot -p 管理员密码
配置MySQL管理员密码:
sudo mysqladmin -u root password newpassword
卸载MySQL:
sudo apt-get autoremove –purge mysql-server-5.0
sudo apt-get remove mysql-server
sudo apt-get autoremove mysql-server
sudo apt-get remove mysql-common
执行以下命令清理残留数据:
dpkg -l |grep ^rc|awk '{print $2}' |sudo xargs dpkg -P2024-10-16