Home > Database > Mysql Tutorial > body text

Detailed explanation of MySQL5.1 installation under Linux

黄舟
Release: 2017-03-01 14:13:59
Original
1513 people have browsed it

Preparation for installation

1. You need the mysql installation package and unzip it. Use the unzip command tar -zxvf + compressed package name
Detailed explanation of MySQL5.1 installation under Linux
2. Copy it to the location where it needs to be installed
Detailed explanation of MySQL5.1 installation under Linux
I plan to install it in the /usr/local/mysql directory
3. Create a mysql user and mysql group for managing mysql
Detailed explanation of MySQL5.1 installation under Linux

Start the installation

1. Configure installation and other information

./configure --prefix=/usr/local/mysql/   
--with-charset=utf8 --with-extra-charsets=all 
--with-unix-socket-path=/usr/local/mysql/var/mysql.sock 
--with-named-curses-libs=/lib/libncursesw.so.5
Copy after login

View the installation configuration parameter method./configure –help
Detailed explanation of MySQL5.1 installation under Linux
Configuration of common parameters:

Parameter Description
–prefix= /usr/local/mysql/ Installation path
–with-charset=utf8 mysql default character set
with-extra-charsets=all Support multiple languages
–with-unix-socket-path=/usr/local/mysql/var /mysql.sock This specifies the location and file name of the online socket file after the mysql server is started. In other words, if the CentOS mysql server is successfully started, it can be found in //usr/ See the mysql.sock file in the local/mysql/mysql/var directory. If you can’t see it, it must be that CentOS mysql cannot be started.
–with-named-curses-libs=/lib/libncursesw.so.5 In order to allow mysql to Identify the path

The character set allowed by mysql is
Detailed explanation of MySQL5.1 installation under Linux
The configuration completion interface is as follows
Detailed explanation of MySQL5.1 installation under Linux
2. Execute make Command
If the following error is prompted at this time
No curses/termcap library found
Detailed explanation of MySQL5.1 installation under Linux
Solution:
Solution (CentOS)
yum list|grep ncurses
yum -y install ncurses-devel
The final interface is as follows
Detailed explanation of MySQL5.1 installation under Linux
3. Execute the make install command

4. Create mysql authorization table
After doing these tasks, you must create the CentOS mysql authorization table, otherwise the database will not start. The commands for mysql installation are all installed in the directory /usr/local/mysql/bin.
After running the mysql_install_db command, if we check /usr/local/mysql, we will find that there is a var directory. This directory is where all databases are installed. For example, after we create the xxpt database, there will be a xxpt directory in the /usr/local/mysql/var directory.
Detailed explanation of MySQL5.1 installation under Linux

Start MySQL

Start mysql
mysql.server start
Detailed explanation of MySQL5.1 installation under Linux
Close mysql
mysql.server stop

The mysql.server file is located in the /usr/local/mysql/share/mysql directory.

The above is the detailed explanation of MySQL5.1 installation under Linux. For more related content, please pay attention to the PHP Chinese website (www.php.cn)!


Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template