CentOS系统安装MySQL数据库

1 安装MySQL yum源

# wget https://dev.mysql.com/get/mysql80-community-release-el7-3.noarch.rpm
# yum install mysql80-community-release-el7-3.noarch.rpm 

2 安装MySQL

# yum install mysql-community-server

安装完成

3 启动MySQL

# service mysqld start

查看是否启动成功

# ps -ef | grep mysql

4 进入MySQL数据库
查看mysql root用户密码

# grep 'temporary password' /var/log/mysqld.log

进入数据库

# mysql -uroot -p

输入密码

5 MySQL服务启动、停止、重启

# service mysqld start
# service mysqld stop
# service mysqld restart

你可能感兴趣的:(沐白杂记(Java),数据库,mysql,centos)