, go to/usr/share/MySQL/and find *. copy one of the CNF files to/etc/and change it to my. CNF. The command is 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,
, glue the Mysqld_multi--example the resulting files, and modify the corresponding attributes, such as: Mysqld,mysqladmin,socket,port, Pid-file,datadir,user and so on.
Copy Code code as follows:
[Mysqld_multi]
Mysqld =/usr/local/mysql/bin/mysqld_safe
Mysqladmin =/usr/local/mysql/bin/mysqladmin
#user = MySQL
#password = My_password
[Mysqld1]
Soc
In practice, we need to configure the security of the MySQL server to use the MySQL database more securely. The configuration files are also different because of Chroot. If you encounter similar situations in actual operations, but you do not know how to solve them correctly, so the following articles must be good teachers and friends for you.
1. Disable remote connection
First, disable port 3306, which is
/mysql[root@leafmysql]#bin/mysqld_safe--user=mysql16030612:12:45mysqld_safeLoggingto'/var/log/mysqld.log'.16030612:12:45mysqld_safeStartingmysqlddaemonwithdatabasesfrom/var/lib/mysql
We can see that there is no prompt to terminate the operation. Let's check whether the mysql service has been started:
[root@leaf~]#netstat-antupActiveInternetconnections(serversande
Mysql ResourcesMysql5.1 Chinese Reference ManualMysql ManagementInstall mysql5.5 using mysql Binary Package Based on linuxMysql client command line optionsMysqld server system variables and status variablesMysql SQL Server ModeMysql account managementMysql Log File Mysql column typeMysql database operationsCreate and Delete tables in mysqlModify a table in mysql
Logfiles, databases
/usr/share/info
Manualin Info format
/usr/share/man
Unixmanual pages
/usr/include/mysql
Include (header) files
/usr/lib/mysql
Libraries
/usr/share/mysql
Miscellaneoussupport files, including error messages, character set files, sample configuration files, SQL for database installa
mysqld_safe mysqld from pid file/var/run/mysqld. pid endedCause:Open the/var/log/mysqld. log file to get the Can't create/write to file '/var/run/mysqld. pid' (Errcode: 2)Can't start server: can't create PID file: No such file or directorySolution:Go to the/var/run directory and find that there is no mysqld directory. Create the mysqld directory, enter the directory, create the mysqld. pid file, and modify the File Attribute chown-R mysql mysqld.Conn
settings before installation
Create the mysql installation directory and data storage directory# Mkdir/opt/mysql# Mkdir/opt/mysql/data
Create users and user groups# Groupadd mysql# Useradd-g mysql
Grant the data storage directory permission# Chown
through socket '/tmp/mysql. sock' (2)
[Mysql @ mydev ~] $ Cd/u01/mysql/bin
[Mysql @ mydev bin] $./mysqld_safe
[Mysql @ mydev bin] $ mysql
24. grant option
With grant option, you can g
Groupadd mysql
Create a user group named mysql
Useradd-g mysql
Create a user named mysql under the mysql user group
Gunzip | mysql-VERSION.tar.gz | tar-xvf-
Decompress the downloaded .gz File
Cd
.-DWITHOUT_FEDERATED_STORAGE_ENGINE = 1-DWITHOUT_PARTITION_STORAGE_ENGINE = 1
If you want to compile it into other functions, such as SSL, you can use the following options to compile a database or not use a database:
-DWITH_READLINE = 1-DWITH_SSL = system: Use the built-in SSL library on the system.-DWITH_ZLIB = system-DWITH_LIBWRAP = 0
Other common options:
-DMYSQL_TCP_PORT = 3306 set the default port-DMYSQL_UNIX_ADDR =/tmp/mysql.
mysql:1. decompress the source code file---- Shell locates the directory where the source code file is located---- ExtractShell :~ $ Tar zxvf mysql-5.5.8.tar.gz2. cmake operation---- Shell located to the decompressed source code folder directory (folder: mysql-5.5.8)---- Cmake:---------------------------------Shell :~ $ Cmake-DCMAKE_INSTALL_PREFIX =/usr/local/
// run the mysq command
If it is not started or can't connect to local MySQL server through socket '/tmp/MySQL. Sock' appears'
Solution: # cd/usr/local/MySQL/support-files // enter this directory
#./MySQL. Server start // startGenerate /Tmp/
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.