Linux安装MySQL

Ubuntu安装MySQL

  1. sudo apt-get install mysql-server
  2. apt-get isntall mysql-client
  3. sudo apt-get install libmysqlclient-dev
  4. 检查是否安装成功:
    sudo netstat -tap | grep mysql
  5. 重启 mysql:
    service mysql restart

CentOS安装MySQL

  1. wget http://repo.mysql.com/mysql-community-release-el7-5.noarch.rpm
  2. sudo rpm -ivh mysql-community-release-el7-5.noarch.rpm
  3. yum update
  4. sudo yum install mysql-server
  5. sudo systemctl start mysqld
  6. sudo mysql_secure_installation 设置mysql

你可能感兴趣的:(Linux安装MySQL)