MySQL service maintenance and application design Note (2) 3. MYSQLD stop script: stop_mysql.sh
#! /Bin/sh
Rundir = 'dirname "{GetProperty (Content )}"'
Echo "$ rundir"
/Home/mysql/bin/mysqladmin-u mysql-S "$ rundir"/mysql. sock shutdown
The advantages of using this script a
How to restore the MySQL truncate table (provided that binlog is backed up and enabled)1.1 back up database thunder mysqldump-S/tmp/mysql3316.sock -- single-transaction -- master-data = 2 thunder> thunder_full_2015112. SQL 1.2 for truncate table operation and insert into table
(work)root@localhost:mysql3316.sock [(none)]>select * from thunder.tb1;+----+---------+
This article mainly introduces how to use mysqli functions in PHP to connect to mysql. the following error occurs: warning: mysqli: real_connect () :( hy0001040 ):... for more information, see the background: when I replace mysql with mysqli, there are too many connections, which is actually not because I moved the php sock file location, because these socket mod
Mysql database binary installation and basic entry operations, mysql binary
Mysql Databases have a lot of knowledge. It takes the same effort and time to learn linux. The small Editor also only has some skins to share with you ~1. Install MySQL
(1) installation method:
1,Install the yum package.
Advantages: fast and si
-5.6.22
V. Compile and install MySQLFrom mysql 5.5, mysql source code installation began to use cmake, and the source code compilation configuration script was set.
-DCMAKE_INSTALL_PREFIX = dir_name
Set the mysql installation directory
-DMYSQL_UNIX_ADDR = file_name
Set the listening socket path, which must be an absolute path name. The def
root mysql 4096 Mar 22 man
Drwxr-xr-x 10 root mysql 4096 Mar 22 mysql-test
-Rw-r -- 1 root mysql 2496 Jul 15 2013 README
Drwxr-xr-x 2 root mysql 4096 Mar 22 scripts
Drwxr-xr-x 27 root mysql 4096 Mar 22 share
Drwxr-xr-x 4 roo
MySQL port is not displayed, wait a few seconds for MySQL service to start up a bit slowly.(2) If not, please check the error log, the error log path under the MY.CNF profile path.grep log-error/data/3306/mysql_zbf3306.err|tail-1(3) Take a closer look at the output returned by all execution commands, and do not ignore the key output results.(4) Check the/var/log/messages of the system.(5) If it is a relate
as follows:
[Root @ test1 mysql] # cp/usr/share/mysql/my-medium.cnf/etc/my. cnf
5. Edit the MySQL configuration file/etc/my. cnf.
To ensure that MySQL works properly, you must specify the location where the mysql. sock file is ge
Detailed process of MySQL5.6.12 compilation and installation by source code
1 download the installation package download tar.gz
Wget http://download.csdn.net/detail/mchdba/7545037
2. install the cmake software package
Yum install cmake-y
3 create account of mysql
Groupadd mysql
Useradd-g mysql
Autoreconf -- force -- install
Libtoolize -- automake -- force
Au
available account:
#/Usr/local/mysql/bin/mysql-u maa-p addbook
Enter password:
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with-
Welcome to the MySQL monitor. Commands end with; or \ g.
Your MySQL connection id is 211 to server version
[Problem] when using mysqli function in PHP to connect to mysql, the following error occurs: warning: mysqli: real_connect () :( hy0001040 ):. background: when mysql is changed to mysqli, there are too many connections. actually, this is not because I moved the sock file location of php, because these socket modifications were not completely modified, so the emer
MySQL database migration data folder location detailed steps bitsCN.com
Because the data directory of the database is under/var/lib by default when mysql is installed in yum, it needs to be moved to the/data partition for data security considerations. The procedure is as follows:1. disable apache and mysql.Service httpd stopService mysqld stop2. move the mysql di
:
Check whether mysql is successfully started:
Input: ps-ef | grep mysql
Modify the root user password of mysql. If the initial root password is empty:
Run the command:./bin/mysqladmin-u root-h localhost. localdomain password 'Password'
Put the mysql client in the default path:
Ln-s/usr/local/
When MySQL was started yesterday, it was not very normal. I had to restart it several times. However, I was not concerned about it when it was able to be started. Today, the test and test encountered a problem. MySQL started normally but could not be closed:
[Root @ rac2 MySQL] # service MySQL stop
and the pos position node. -S parameter mysql multi-instance usage. For details, see "mud: mysql5.5 multi-instance deployment". As follows:
Mysql-uroot-p123456-S/data/3307/mysql. sock-e "show master status"
Note that you can use man to query the usage of the preceding commands. For example,
; delete from friends where name = "Paa ";
Query OK, 1 row affected (0.01 sec)
Mysql> select * from friends;
+ ------- + ---------- + --------- +
| Name | telphone | icq | address |
+ ------- + ---------- + --------- +
| Cxlin | 7654321 | 39425893 | Taoyuan County |
+ ------- + ---------- + --------- +
1 row in set (0.00 sec)
Finally, after the database and data table are created, grant the permission (select, insert, update, and delete) of all dat
] # cd bin
[Root @ www bin] #./mysql_install_db for database initialization
Modify permissions:
[Root @ www mysql] # chown. mysql-R. // recursively modify the group of all files in the current directory (mysql installation directory) as the mysql Group
[Root @ www mysql] #
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.