Ubuntu安装和卸载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 ...
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
mengvlog 阅读 55 次 更新于 2025-12-16 19:17:42 我来答关注问题0
檬味博客在线解答立即免费咨询

mySQL相关话题

Copyright © 2023 WWW.MENGVLOG.COM - 檬味博客
返回顶部