当前位置:网站首页>MySQL - Installation

MySQL - Installation

2022-06-10 03:54:00 Storyteller

install MySQL

1、 To configure yum Source

wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-8.repo

2、 install MySQL

yum install mysql-server

3、 Start the service

[[email protected] yum.repos.d]# systemctl start mysqld

4、 Get into MySQL

##  Ciphertext password to enter 
[[email protected] yum.repos.d]# mysql -uroot -p
##  Plaintext password entry 
[[email protected] yum.repos.d]# mysql -uroot -p password 
-u user name 
-hIP
-p password 

5、 Change Password

//8.0 After the version   Use root Password-free login 
use mysql;
flush privileges;
ALTER USER 'root'@'localhost' IDENTIFIED BY ' password ';
// 8.0 Before the release 
net stop mysql	// close mysql
mysqld --shared-memory --skip-grant-tables 

mysql -uroot -p
use mysql;

// Just change the password 
update user set passworde=' password ' whereuser user='root';
update user set password=PASSWORD(' password ') whereUser='root'
alter user [email protected]'localhost' identified by '123'

The configuration file

/etc/my.cnf

Log location

/var/log/mysql/mysqld.log 

window install MySQL

windows Modify environment variables

  • The bin Copy the path of the directory
  • My computer > attribute > Advanced system settings > environment variable > edit path
原网站

版权声明
本文为[Storyteller]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/161/202206100340162453.html