In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)05/31 Report--
This article introduces the relevant knowledge of "how to build a stand-alone instance of Mysql". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!
1 launch item vim / etc/apparmor.d/usr.sbin.mysqld/etc/init.d/apparmor reload
AppArmor (Application Armor) is a security module of the Linux kernel. AppArmor allows system administrators to associate each program with a security profile, thus limiting the functionality of the program. To put it simply, AppArmor is an access control system similar to SELinux, through which you can specify which files the program can read, write or run, whether it can open network ports, and so on. As a supplement to the discretionary access control module of traditional Unix, AppArmor provides a mandatory access control mechanism, which has been integrated into the 2.6 version of the Linux kernel.
2 create the data directory of the new instance mkdir / var/lib/mysql2 create directory chown mysql / var/lib/mysql2 give mysql user rights 3 create the database and initialize the database
Mysql 5.7 and below
Mysql_install_db-user=mysql-datadir=/var/lib/mysql2
Mysql 5.7 +
-user=mysql-datadir=/var/lib/mysql2
4 configure multi-instance configuration file [mysqld_multi] mysqld = / install/mysql/bin/mysqld_safe mysqladmin = / install/mysql/bin/mysqladmin user = root # The MySQL server [mysqld1] port = 3306 socket = / tmp/mysql.sock datadir = / var/lib/mysql pid-file = / var/lib/mysql/mysql.pid user = mysql log-bin = master-bin log-bin-index = master-bin.index... [mysqld2] port = 3307 socket = / tmp/mysql2.sock datadir = / var/lib/mysql2 pid-file = / var/lib/mysql2/mysql.pid user = mysql. 5 start the instance mysqld_multi-- defaults-file=/etc/mysql/my_multi.cnf start 1mysqld_multi-- defaults- File=/etc/mysql/my_multi.cnf start 26 log in to Mysql# and log in to MySQL server Execute the mysql command to enter the mysql console mysql-uroot-P3307-p-S/tmp/mysql2.sock# without entering a password, enter directly # to view the current user select User from mysql.user # create Mysql user test and grant permissions to CREATE USER 'test'@'%' IDENTIFIED BY' 123456 users to make Grant GRANT OPTION ON *. * TO 'test'@'%';GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, TRIGGER ON *. * TO' test'@'%' This is the end of the content of "how to build a stand-alone instance of Mysql". Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!
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.