prototyped as follows:void STDCALL mysql_free_result(MYSQL_RES *result);(9), when the MySQL database is no longer queried, call the Mysql_close function to close the database connection. The prototype of the Mysql_close function is:void STDCALL mysql_close(MYSQL *sock);4. MySQL C API Programming Example:#if defined (
Installing Mysql-5.5.9 in Linux (40) creating users and user groups
Groupadd mysql
Useradd-g mysql
Download:Bison-2.5.tar.gzCmake-2.8.4.tar.gzM4-1.4.9.tar.gzMake-3.82.tar.gzMysql-5.5.9.tar.gzNcurses-devel-5.7-3.20090208.el6.i686.rpm
Decompress:Tar-zxvf bison-2.5.tar.gzCd bison-2.5./ConfigureMakeMake install
Tar-zxvf cmake-2.8.4.tar.gzCd cmake-2.8.4./Configure
Create a MySQL user and a MySQL user groupGroupadd MySQLUseradd-G MySQL
Install MySQL using the source package
1.download the mysqlinstallation package (.tar.gz) from mysql's official website)Http://dev.mysql.com/get/Downloads/MySQL-5.0/
configuration file
Copy codeThe Code is as follows:[Client]
Character-set-server = utf8
Port = 3306
Socket =/tmp/mysql. sock
[Mysqld]
Character-set-server = utf8
Replicate-ignore-db = mysql
Replicate-ignore-db = test
Replicate-ignore-db = information_schema
User = mysql
Port = 3306
Socket =/tmp/
-p‘123456‘2. Remote connection login Mysql,a machine Connection b server MySQL, you need to add IP and port, as follows:[[emailprotected] ~]# mysql -uroot -pszyino-123 -h127.0.0.1 -P3306 //-h用来指定远程主机的IP -P指定端口 Warning: Using a password on the command line interface can be insecure.Welcome to the MySQL monitor. 3. Usi
://mysql.he.net/Downloads/MySQL-4.0/mysql-4.0.16.tar.gz
Decompress:
# Tar-zxvf mysql-4.0.16.tar.gz
Generally, MySQL is installed in/usr/local/mysql. you can adjust it if you have special requirements. However, this is of little significance, because Chrooting will b
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
. I feel that with-charset is only useful in alphabetical order, these options will cause a lot of trouble for data migration.
Configure -- prefix =/home/mysql
Make
Make install
Service start and stop
======================
1. copy the default mysql/var/mysql to the/data/app_1/directory,
2 MYSQLD startup script: start_mysql.sh
#! /Bin/sh
Rundir = 'dirname "
I encountered a problem connecting to the mysql database today: Can't connect to local MySQL server through socket '/tmp/mysql. sock' (2)
Solution 1.
1. # ps-A | grep mysql
Display is similar:
1829? 00:00:00 mysqld_safe
1876? 00:00:31 mysqld
2. # kill-9 1829
3. # kill-9 1876
temporary files
Chown-R mysql: mysql/data/mysql
5) compile and install MySQL using cmake
[Plain]
Tar zxvf mysql-5.6.13.tar.gz
Cd mysql-5.6.13
Cmake.-DCMAKE_INSTALL_PREFIX =/opt/mysql-p
socket file is not removed. Please check the below use cases and apply the appropriate resolution.1. View/var/log/mysqld. log. You will find a log similar to the following:
123456789
13120721: 15: 47mysqld_safeStartingmysqlddaemonwithdatabasesfrom/var/lib/mysql/usr/libexec/mysqld: Can't create/write to file '/tmp/ib0h0Wt3' (Errcode: 13) 131207 21:15:47 InnoDB: Error: unable to create temporary file; errno: 13131207 21:15:47 [ERROR] Plug
Note: When MySQL was started before bitsCN.com, it was not very normal. it had to be restarted several times, but it was not important to start it. Today, the test has encountered a problem, mySQL can be started normally, but cannot be closed:
[Root @ rac2 mysql] # service mysql stop
This article describes how to solve the problems related to PID File loss in MySQL. the specific prompt may be mysqlPIDfilenotfoundandCan 'tconnecttomysqlthroughsocketmysql. sock, A friend who needs it can refer to my colleague A today to find me, saying that Mysql server X has A high load and the query is slow. After a while of failure, we watched it together.
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.