MySQL startup Principle Analysis, mysql Principle AnalysisIntroduction
This article focuses on viewing the MySQL startup command code to learn more about the MySQL startup process. It is important to understand the MySQL startup principle and be familiar with
The first part is to build a multi-mysql service on a server.
I. xuyanThere is a mysqld_multi command in Mysql that can be used to run multiple Mysql services on one physical server. I am so glad to refer to some documents and test it and pass it in person. Now I will share the operation process with you!Operating System: Linux 2.6.13 (Slackware). Other versions
database as follows:
/Usr/local/mysql/scripts/mysql_install_db -- basedir =/usr/local/mysql/-- datadir =/usr/local/mysql/data/-- user = mysql
We can also see that the mysql database has been initialized successfully. The system also shows how to start
" ledir = "$ MY_PW D/bin "elif test-f" $ relpkgdata "/english/errmsg. sys-a-x "$ MY_PWD/libexec/mysqld" then MY_BASEDIR_VERSION = "$ MY_PWD" ledir = "$ MY_PWD/libexec" else release = '/usr/local/mysql3306 'ledir = '/usr/local/mysql3306/libexec' fi # Find the configuration file and data file directory # Find the configuration file directory # I put it under the etc/directory, mysqld program will read # get the default read from my_print_defaults script my. the
): these nodes are used to save the data of the cluster. The number of data set points is related to the number of copies, which is a multiple of fragments. For example, there are four data nodes for two replicas and two fragments for each copy. There is no need to have more than one copy .. The data node is started with the command ndbd.
SQL nodes: these nodes are used to access cluster data. For MySQL clusters, client nodes are traditional
Directory
[root@rac2 lib]# mv /var/lib/mysql /u01/
2.4 modify my. cnf configuration file
If my. in the cnf configuration file, go to/usr/share/mysql/and find *. copy one of the cnf files to/etc/and change it to my. cnf. Th
in a multi-server environment:
Use the -- defaults-file option to specify each option file, so that each server will not read the/etc/my. cnf configuration files, but will use the configuration files you specified.
You can put some common options in the/etc/my. cnf file, and then use the -- defaults-extra-file option to indicate the specific option file of the specific server. In this way, you do not need
From: http://heylinux.com/archives/1689.html
Background/requirement:Compile and install a MySQL database of Version 5.5 or above through source code on a server;Store all configuration files and data in/opt/MySQL to facilitate fast migration, overall backup, and fast replication in the future;Run two instances in the same MySQL instance, one bound to port 3306 a
directory of MySQL is/var/lib/MySQL. To move the directory to/home/data, perform the following steps:
1. Create a data directory under the Home DirectoryCD/homeMkdir data
2. Stop the MySQL service process:Mysqladmin-u root-P Shutdown
3. Move the entire/var/lib/MySQL directory to/home/DataMV/var/lib/
, run the following command to start mysql in the/etc/init. d directory.
[Root @ test1 init. d] #/etc/init. d/mysql start
2. Stop
/Usr/bin/mysqladmin-u root-p shutdown
3. Automatic Start
1) Check whether mysql is in the Auto Start List
[Root @ test1 local] #/sbin/chkconfig-list
2) Add MySQL to the startup Service Group
MySQL multi-instance Configuration
Lab environment: RHEL6.4 for minimal installation, mysql installation package for general binary installation package, version for mysql-5.6.26
1. Create a mysql user
# Useradd-M-s/sbin/nologin mysql
# Yum-y install ncurses-devel libaio-dev
Ubuntu is automatically started when mysql is started under ubuntulinux.
BitsCN.com
Mysql comes with a very useful script for managing mysql services. The default path is $ MYSQL_HOME/support-files. the file name is mysql. server. $ MYSQL_HOME is the installation root directory of
production library, you can use the Percona company's online backup tool for backup.Replicate a copy of the MY1.CNF to another location for backup, preventing the upgrade from failing to recover ins1 quickly.3. Close Ins1Mysqladmin-uroot-p-S $sockdir 4. Ins1 the original data directory via MySQL 5.5.36 boot instance, named Ins21) Modify the my1.cnf to change so
. Change the MySQL directory
The default data file storage directory of MySQL is/var/lib/MySQL. To move the directory to/home/data, perform the following steps:
1. Create a data directory under the Home DirectoryCD/homeMkdir data
2. Stop the MySQL service process:Mysqladmin-u root-P Shutdown
3. Move the entire/
MGM (MGM node)
Delete the built-in my. cnf File
You must delete the built-in/etc/my. cnf. If not, you do not need to delete it.
# Rm-rf/etc/my. cnf
Create a directory for storing configuration files
# Mkdir/main/mysql/etc
# Chown mysql:
Resolve remote connection to manage MYSQL database bitsCN.com on other machines
In the development process, you sometimes need to remotely connect to and manage the MYSQL database on another machine. in the implementation process, you may encounter a series of problems, now, we use remote access to MYSQL data installed on Ubuntu as an example (the default port is
Then, configure MySQL.
[Root @ sample ~] # Vi/etc/my. cnf plugin edit the MySQL configuration file[Mysqld]Datadir =/var/lib/mysqlSocket =/var/lib/mysql. sock# Default to using old password format for compatibility with mysql 3.x# Clients (th
+ table_cache * 2 (whichever is larger)
Number of files.
If open_files_limit is not set to 0, the result calculated by the setrlimit () function prevails. if it is set to 0, the actual value is max_connections * 5 or max_connections + table_cache * 2.
Therefore, to solve the problem that the number of opened files exceeds the limit, you also need to combine the system kernel limits (ulimit-n), mysqld's own limits (open_files_limit), and the number of table caches (table_open_cache) and other fa
directory/var/lib/mysql/2. Configuration File/usr/share/mysql (mysql. server commands and configuration files) 3. Related commands/usr/bin (mysqladmin mysqldump and other commands) 4. STARTUP script/etc/rc. d/init. d/(directory for starting the script file mysql)
7. Change the My
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.