Home > Database > Mysql Tutorial > Ubuntu安装和卸载MYSQL

Ubuntu安装和卸载MYSQL

WBOY
Release: 2016-06-07 16:34:52
Original
1036 people have browsed it

安装 mysql sudo apt-get install mysql-serversudo apt-get install mysql-clientsudo apt-get install php5-mysql // 安装php5-mysql 是将php和mysql连接起来 一旦安装完成,MySQL 服务器应该自动启动。您可以在终端提示符后运行以下命令来检查 MySQL 服务

安装 mysql

sudo apt-get install mysql-server
sudo apt-get install mysql-client
sudo apt-get install php5-mysql  // 安装php5-mysql 是将php和mysql连接起来
Copy after login

一旦安装完成,MySQL 服务器应该自动启动。您可以在终端提示符后运行以下命令来检查 MySQL 服务器是否正在运行:

sudo netstat -tap | grep mysql
Copy after login

当您运行该命令时,您可以看到类似下面的行:

tcp 0 0 localhost.localdomain:mysql *:* LISTEN -
Copy after login

如果服务器不能正常运行,您可以通过下列命令启动它:

sudo /etc/init.d/mysql restart
Copy after login

进入mysql

$mysql -uroot -p 管理员密码
Copy after login

配置 MySQL 的管理员密码:

sudo mysqladmin -u root password newpassword
Copy after login

卸载 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 //这个很重要上面的其实有一些是多余的
Copy after login

清理残留数据

dpkg -l |grep ^rc|awk '{print $2}' |sudo xargs dpkg -P
Copy after login

Posts related to Ubuntu安装和卸载MYSQL

用yum安装完mysql后没有mysqld的问题

用yum安装完mysql后没有mysqld的问题

Ubuntu安装webmin1.54失败

Ubuntu安装webmin1.54失败

samba服务器设置目录密码时候的几个参数和注意事项

samba服务器设置目录密码时候的几个参数和注意事项

Linux lsof命令

Linux lsof命令

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template