Service Startup for multiple instance startup files:Mysqld_safe -- defaults-file =/data/3306/my. cnf 2> 1>/dev/null Mysqld_safe -- defaults-file =/data/3307/my. cnf 2> 1>/dev/null
Stop the MySQL service in the Multi-instance Startup File:Mysqladmin-u root-p passwd-S/data/3306/mysql. sock shutdownMysqladmin-u root-p passwd-S/data/3306/
is required before compilation.Cmake-2.8.4 and bison-2.4.3Decompress mysql-5.5.15.tar.gz after successful installation:Open the terminal in the source code root directory and enter the following configuration parameters and press Enter.Cmake-DCMAKE_INSTALL_PREFIX =/etc/mysql \-DMYSQL_UNIX_ADDR =/etc/mysql. sock \-DDEF
Mysql creates multiple instances. In fact, it points the DATA file, SOCK, and PORT to different files and ports. For mysql installation process, see blog. csdn. nettangpengtaoarticledetails6650424 first create a 3307 data directory [root@localhostmysql-5.5.15] # mkdir-pusrlocalmysql3307 [root @ localhost
When mysql cre
mysqld services:[[emailprotected]mysql2]#netstat-nlp|grepmysqldtcp 000.0.0.0:3306 0.0.0.0:* listen1203/mysqldtcp 000.0.0.0:3307 0.0.0.0:*listen 1744/mysqldunix2 [acc]streamlistening 88041203/mysqld/tmp/mysql.sockunix 2nbSp;[acc]streamlistening 141591744/mysqld/tmp/mysql2.sock2. Configure master-Slave preparation workSet Mysql_2 primary (master) port 3307,mysql to slave (slave) port to 3306Log in to master MySQL
Shell>Bin/mysqld_safe -- user = mysql
# Next command is optional
Shell>Cpsupport-files/mysql. server/etc/init. d/mysql. server
PS: The difference is,Bin/mysqld -- initialize -- user = mysql# MySQL 5.7.6 and up
2. add a mysql
/sysbench/oltp_common.lua--tables=4--table-size=100000--threads=2--time=60-- report-interval=10 Prepare
Stop synchronizing at the slave end when importing data from the main library, inconsistent manufacturing data [Email protected]:mysql3307.sock [Mysql]>stop slave
3. When the Sysbench is finished, view the data of the master library and the slave data Main Library: [Email Protected]:mysql3307.
-- socket =/tmp/mysql. sock4
........................................ .....
4. Client Access
To access any client, you must specify the access port to access the specified database service. Otherwise, the default Mysql port (3306) is used.
**************************************** ******************
The second part is to build a multi-mysql master service on a se
An error occurred while backing up mysql, but the website is running normally
Localhost :~ #/Usr/local/mysql/bin/mysqldump -- lock-tables = FALSE-uroot-p webadb_com>/root/webabc. SQL
Enter password:
Mysqldump: Got error: 2002: Can't connect to local MySQL server through socket '/tmp/mysql-5.1.57.
. sock file is not found, it indicates that mysql is not started. you can also log on to mysql to test
View process ps-ef | grep mysql
The mysql process is found because it is killed and killed-9 pid
Start the mysql service a
MySQL login summary bitsCN. comMySQL login problem summary: I want to practice MySQL in my own small book. the login result is problematic. after half an hour, I finally got it done, I also summarized these common problems and shared them with you. The author's system is OpenSuSE, and other systems have similar solutions for your reference. First, log on to MySQL
-log file and its runtime environment. for details about all cnf parameters, see mysql document.
# [Client]
# Password = your_password
# Port = 3306
# Socket =/tmp/mysql. sock
[Mysqld_multi]
Mysqld =/usr/local/mysql/bin/mysqld_safe
Mysqladmin =/usr/local/mysql/bin/m
somewhere outside the default location (usually in the directory "/tmp" or "/var/run ", use the configure command like this:
Shell>./configure/-- with-unix-socket-
Path =/usr/local/mysql/tmp/mysql. sock
Note that the given file name must be an absolute path. You can also use the MySQL option file to change the locatio
backup command, you only need to put the following code in the crontab File (sudo vim/etc/crontab:
01 3 *** root/usr/sbin/DataBackup # it indicates that the DataBackup script will be executed at every day
Note the following:
In linux, shell scripts define variables in the format of key = value. Note that there is no space before and after "=" between the two. Otherwise, the system cannot confirm the variables.
For the line marked in red, the first single quotation mark character "'" is no
command in the shell:
cp/usr/local/mysql/bin/ndb_mgm*/usr/local/bin cd/usr/local/bin chmod +x ndb_mgm*
third, configuration Data node (192.168.124.142, 192.168.124.143)1. Adding MySQL groups and usersRun the following command in the shell:
Groupadd MySQL useradd-g mysql
server by trying these different connections (of course, the port number and socket path name may be different in your installation ):Shell> mysqladmin versionShell> mysqladmin variablesShell> mysqladmin-h 'hostname' version variablesShell> mysqladmin-h 'hostname' -- port = 3306 versionShell> mysqladmin-h 'IP for your host' versionShell> mysqladmin -- socket =/tmp/mysql. sock version
Note that the hostname
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/
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.