In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-05 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly explains how to install mysql6 initialization installation password under centos7, the content is clear, interested friends can learn, I believe it will be helpful after reading.
1. Stop the database server first
Service mysqld stop
2.vim / etc/my.cnf
3. Profile add skip-grant-tables
[root@VM_0_8_centos] # vim / etc/my.cnf# For advice on how to change settings please see# http://dev.mysql.com/doc/refman/5.6/en/server-configuration-defaults.html[mysqld]## Remove leading # and set to the amount of RAM for the most important data# cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%. # innodb_buffer_pool_size = 128M## Remove leading # to turn on a very important data integrity option: logging# changes to the binary log between backups.# log_bin## Remove leading # to set options mainly useful for reporting servers.# The server defaults are faster for transactions and fast SELECTs.# Adjust sizes as needed Experiment to find the optimal values.# join_buffer_size = 128M# sort_buffer_size = 2M# read_rnd_buffer_size = 2Mdatadir=/var/lib/mysqlsocket=/var/lib/mysql/mysql.sockskip-grant-tables here! # Disabling symbolic-links is recommended to prevent assorted security riskssymbolic-links=0
4. Restart the database
Systemctl restart mysql
5. Log into the database
Mysql-uroot-p
If you ask for a password, log in with an empty password
6.set password for root@localhost = password ('123456'); change the password in parentheses yourself.
7.mysql-uroot-p123456 logged in successfully
PS: let's take a look at Mysql initializing the root password and allowing remote access
Mysql default root user does not have a password, enter mysql-u root to enter mysql
1. Initialize the root password
Access to mysql database
Mysql > update user set password=PASSWORD ('123456') where User='root'
2. You can use the following three ways to allow mysql remote access:
A, change the table.
Mysql-u root-pmysql > use mysql;mysql > update user set host ='% 'where user =' root';mysql > select host, user from user
B, authorization.
For example, you want root to connect to the mysql server from any host using 123456.
Mysql > GRANT ALL PRIVILEGES ON *. * TO 'root'@'%' IDENTIFIED BY' 123456 'WITH GRANT OPTION
If you want to allow user jack to connect to the mysql server from a host with an ip of 10.10.50.127, use 654321 as the password
Mysql > GRANT ALL PRIVILEGES ON *. * TO 'jack'@'10.10.50.127' IDENTIFIED BY' 654321' WITH GRANT OPTION;mysql > FLUSH RIVILEGES
C: run on the machine where mysql is installed:
/ / enter MySQL server d:\ mysql\ bin\ > mysql-h localhost-u root// gives any host the permission to access data mysql > GRANT ALL PRIVILEGES ON *. * TO 'root'@'%' WITH GRANT OPTION// to make the modification effective mysql > FLUSH PRIVILEGES// exit MySQL server mysql > EXIT read the above, is it necessary to have a better understanding of how to install mysql6 initialization installation password under centos7? if you want to learn more, please follow the industry information channel.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.