In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
Modify the data directory after mysql rpm package installation
1. Stop the mysql data service
/ etc/init.d/mysqld stop
two。 Specify permissions for the created data directory
Chmod-R 777 / home/mysql/database/*
Chown-R mysql.mysql / home/mysql/database/*
3. Copy everything from the default data directory to the current directory (or you can do it before the second step)
Cp-r / var/lib/mysql/* / home/mysql/database/
4. Modify the configuration file
Vim / etc/my.cnf
[mysql]
Socket=/home/mysql/database/mysql.sock / / secure signature cover directory of login database
[mysqld]
Datadir=/home/mysql/database / / data directory
Port=3307 / / you can modify the default port number of 3306
Symbolic-links=0
Log-error=/home/mysql/log/mysqld.log / / error log directory
Pid-file=/var/run/mysqld/mysqld.pid
Log_bin = mysql-bin
Server_id = 1
Log_bin_trust_function_creators = on / / when creating functions and stored procedures, resolve the problem of synchronizing from the library
Event_scheduler=on
Max_allowed_packet = 200m
Binlog_format=mixed / / mixed mode saves binary logs
Lower_case_table_names=1
Sql_mode=STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTIO
5. Restart mysql
/ etc/init.d/mysqld restart
6. Log in
Log in locally
Mysql-u root-pReport@123
Remote login
Mysql-uroot-pReport@123-h 192.168.31.64-P3306
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.