在centos7上安装mysql

https://www.digitalocean.com/community/tutorials/how-to-install-mysql-on-centos-7

https://dev.mysql.com/downloads/repo/yum/

https://tecadmin.net/install-mysql-5-7-centos-rhel/

wget https://dev.mysql.com/get/mysql57-community-release-el7-9.noarch.rpm
md5sum mysql57-community-release-el7-9.noarch.rpm

sudo rpm -ivh mysql57-community-release-el7-9.noarch.rpm
sudo yum install mysql-server

sudo systemctl start mysqld
sudo systemctl status mysqld

Note: MySQL is automatically enabled to start at boot when it is installed.
You can change that default behavior with sudo systemctl disable mysqld

sudo grep ‘temporary password’ /var/log/mysqld.log
sudo mysql_secure_installation

mysqladmin -u root -p version

/* CREATE NEW DATABASE */
mysql> CREATE DATABASE mydb;

/* CREATE MYSQL USER FOR DATABASE */
mysql> CREATE USER ‘db_user’@’localhost’ IDENTIFIED BY ‘password’;

/* GRANT Permission to User on Database */
mysql> GRANT ALL ON mydb.* TO ‘db_user’@’localhost’;

/* RELOAD PRIVILEGES */
mysql> FLUSH PRIVILEGES;

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值