groupadd mysql # add to mysql Group
useradd -g mysql mysql -s /bin/false # Create user mysql To join the mysql Group , Don't allow mysql Users log in to the system directly
mkdir -p /data/mysql # establish MySQL Database storage items
chown -R mysql:mysql /data/mysql # Set up MySQL Database directory permissions
mkdir -p /usr/local/mysql # establish MySQL The installation directory
cd /opt
tar zxvf mysql-5.5..tar.gz
cd mysql-5.5. cmake -DCMAKE_INSTALL_PREFIX=/usr/local/mysql \
-DMYSQL_UNIX_ADDR=/tmp/mysql.sock \
-DDEFAULT_CHARSET=utf8 \
-DDEFAULT_COLLATION=utf8_general_ci \ -DWITH_EXTRA_CHARSETS=all \ -DWITH_MYISAM_STORAGE_ENGINE= \
-DWITH_INNOBASE_STORAGE_ENGINE= \
-DWITH_MEMORY_STORAGE_ENGINE= \
-DWITH_READLINE= \
-DENABLED_LOCAL_INFILE= \
-DMYSQL_DATADIR=/data/mysql \
-DMYSQL_USER=mysql \
-DMYSQL_TCP_PORT= \
-DSYSCONFDIR=/etc \
-DINSTALL_SHAREDIR=share
make && make install
Start configuration after installation MySQL:
cp ./support-files/my-huge.cnf /etc/my.cnf # Copy configuration file ( Be careful : If /etc By default, there is a my.cnf, Direct coverage )
vi /etc/my.cnf # Edit profile , stay [mysqld] Add the following line to the section
datadir = /data/mysql # add to MySQL Database path
:wq! # Save and exit cd /usr/local/mysql start-up mysql I want to put the data file of the database under another directory when I'm working , The start command is changed to : Be careful : Instance Directory ,, There was an error during the installation .
shell>/usr/local/mysql/bin/mysqld_safe --user=mysql --log-error=/u01/mysql/mysql_error/error --datadir=/data/mysql/ At this time, there are problems ,
Because when initializing the database permission table, the permission table created by default is in the default directory /usr/local/mysql/var below , That's what happened , The above error cannot find the permission table :Can't
open and lock privilege tables: Table 'mysql.host' doesn't exist

./scripts/mysql_install_db --user=mysql --datadir=/data/mysql # Generate mysql System database Be careful : Because the database needs to be saved in another directory Add parameters when initializing permission table --datadir cp ./support-files/mysql.server /etc/rc.d/init.d/mysql # hold Mysql Join the system to start

chmod /etc/init.d/mysql # Add execution permission

chkconfig mysql on # chkconfig mysqld on
vi /etc/rc.d/init.d/mysql # edit
basedir = /usr/local/mysql #MySQL Program installation path
datadir = /data/mysql #MySQl Database storage directory
service mysqld start # start-up
vi /etc/profile # hold mysql Services add system environment variables : Add the following line at the end
export PATH=$PATH:/usr/local/mysql/bin
:wq! # Save and exit
 The next line myslq The library file of is linked to the default location of the system , So you're compiling something like PHP When waiting for the software, you don't need to specify mysql The library file address of .
ln -s /usr/local/mysql/include/mysql /usr/include/mysql
reboot # Need to restart the system , Wait for the system to restart and continue to operate under the terminal command line 
mysql_secure_installation # Set up Mysql password
Press... At the prompt Y enter
Then input 2 Secondary cipher
Continue to press Y enter , Until the setup is complete
Or just change the password /usr/local/mysql/bin/mysqladmin -u root -p password "" # Change Password
service mysqld restart # restart
Here we are ,mysql installation is complete !

centos 6.5 32 position Compilation and installation Mysql More articles about

  1. CentOS 6.5 64 Install under the position MySQL 5.7.11

    Yesterday spent the whole afternoon in CentOS6.5 Installed on MySQL, Version is 5.7.11, Let's talk about the problems I encountered during the installation And Solutions , For your reference . 1/ Remove the residue rpm -qa | grep mysql // ...

  2. win7 32 Install under the position MySQL The emergence of ---1067 System error --- Problems and Solutions

    Every time you install the database , There are always problems like this and that . Now record it , For future reference .... The download is decompression -zip Version number of . For the installation and configuration tutorial, please refer to brother Hong's notes -<MySQL-5.6.13 Decompression version (zip edition ) Installation and configuration tutorial ...

  3. CentOS 6.0 Minimize compilation installation Nginx+MySQL+PHP+Zend

    http://www.osyunwei.com/archives/235.html introduction : operating system :CentOS 6.0 32 position          Download address :http://mirrors.163.co ...

  4. Qt for Linux: Environment building (CentOS 6.5 32 position )—— Completely from scratch

    Before the text begins , We assume that , The user can operate the terminal Have root jurisdiction , All of the following operations are also performed by root complete You can go online Installed CentOS 6.5 32 position notes : The red part , Everyone may be different Don't talk much , List the general process of this chapter 1 ...

  5. CentOS 7 Structure GCC 4.8.2 32 Bit compilation environment

    centos 7 Structure gcc 32 Bit compilation environment 1 Introduce 1.1 background Learning new C++ 2011 and C11 standard . 1.2 Use software CentOS 7(Linux version 3.10.0-123.el7. ...

  6. Use centos 5.x 32 Bit system installation astgo 2014 v7.0 course ( Complete set of installation documents included )

    Version features : Fully automatic installation There is no need to input frequently during installation yes Or press enter With a complete number of home database It comes with a touch screen version WAP · First make sure you need to use astgo 2014 7.0 still 7.3: astgo 2014 v 7.0 ...

  7. CentOS Compilation and installation mysql

    1. Preparation 1.1 Environmental statement : operating system : CentOS release 6.4 (Final) [ View command cat /etc/redhat-release ] mysql : mysql-5.6. ...

  8. CentOS 7.2 Use source code package to compile and install MySQL 5.7.22 And some operations

    CentOS 7.2 Use source code package to compile and install MySQL 5.7.22 And some operations 2018 year 07 month 05 Japan 00:28:38 String Feng Feng   Read the number :2614   Use yum Installed MySQL The general version is older , but ...

  9. CentOS Source code compilation and installation MySQL 5.5.15

    CentOS Source code compilation and installation MySQL 5.5.15   List of articles [ hide ] Install the compiler Download the source code install cmake and bison Compilation and installation MySQL Some related settings Install the compiler yum install g ...

Random recommendation

  1. MyBatis - MyBatis Generator Generated example How to use and or Simple hybrid query

    Brief introduction : Criteria, Contains a Cretiron Set , every last Criteria Object contains Cretiron Between is by AND Connected , It's the relationship between logic and . oredCriteria,Example There is a ...

  2. centos7 web Server kernel optimization

    net.ipv4.tcp_syn_retries = 1net.ipv4.tcp_synack_retries = 1net.ipv4.tcp_keepalive_time = 600net.ipv4 ...

  3. jQuery Application of ( One ) Use jQuery Selectors ( commend )

    As mentioned above ( Address )jQuery Advance javascript Programming for , Provides a plan for all css3 Standard selector under , Developers can use these selectors to easily select various elements , for javascript Use . It is important to jQuery For these choices ...

  4. [Albert Read the action notes ] Adopt Scalers Method : Oral growth action

    The goal is :100 Hour growth plan , Keep reading the tape 100 Hours . A plan of action : Comment on Meiyin every day 3 Personal reading , English pronunciation 1 individual . Finish the reading plan , Record a paragraph . Appendix 1 paragraph .1 About half . Start date :3 month 18 Japan Original post : [335][ A collection ]Sca ...

  5. install Apache appear &lt;OS 10013&gt; Made an attempt to access the socket in a way that the access permission is not allowed

    In the installation Apache In the process of : Take a closer look at the tips : make_sock: could not bind to address 0.0.0.0:80 See light suddenly , Installed on your computer IIS7,80 Port occupied . hit ...

  6. monitor Activity Switching between the front and the back

    public class BaseActivity extends Activity{ @Overrideprotected void onStop() { boolean isOnForegroun ...

  7. web Front end utilization HSTS( new Web Security protocols HTTP Strict Transport Security) The super bug Cookie(HSTS Super Cookie)

    web If the front end wants to achieve cookie Cross site , Cross browser , Clear browser cookie The cookie And it won't be deleted, which seems a bit hard , Here's a tutorial to get rid of document.cookie 1. Server settings HSTS Such as PHP ...

  8. Dos Command will merge the contents of two text files

    When the problem with the production line , There's one that puts b.txt The content of is added to a.txt It takes . Thinking about this . My first feeling is typing code . read b.txt Content , Write gradually a.txt. Think of yesterday in the processing line 600M The way to decide , I use java ...

  9. Access... In the general processing file Session Need to add IRequiresSessionState

    stay IHttpHandler Use Session Usually we often , adopt session Determine whether the user is logged in . There are also some temporary . Important data is also stored in Session in . On the page we can easily get Session Value , but ...

  10. linux Next use select Realize precise timer

    When writing a program , We often use timers . This article describes how to use select Realize the super clock . Use select function , We can achieve a subtle level of precision timer . meanwhile ,select Function is also a function that we often use when writing non blocking programs . ...