Compile and install MYSQL 5.1 and Innodb in Linux

Source: Internet
Author: User
Compile and install MySQL 5.1 and InnoDB in Linux
Compile the mysql5 code:
./configure /        --prefix=/usr/local/mysql /        --localstatedir=/usr/local/mysql/data /        --with-unix-socket-path=/usr/local/mysql/tmp/mysql.sock /        --with-extra-charsets=all /        --with-charset=utf8 /        --with-client-ldflags=-all-static /        --with-mysqld-ldflags=-all-static /        --with-plugins=all /        --with-pthread /        --enable-thread-safe-client        groupadd mysqluseradd -g mysql mysqlcp support-files/my-medium.cnf  /etc/my.cnf

Add User = MySQL code in my. CNF:

cd /usr/local/mysqlbin/mysql_install_db --user=mysqlchown -R root . ; chown -R mysql data ;chgrp -R mysql .bin/mysqld_safe --user=mysql &mysqladmin -uroot password 'new-password'

Start MYSQL: code:

/usr/local/mysql/bin/mysqld_safe &

Close MYSQL: code:

/usr/local/mysql/bin/mysqladmin  shutdown
Code:
cp ./support-files/mysql.server /etc/rc.d/init.d/mysqld

You can use server mysqld restart to start

Precautions for installing MySQL In Debian -- InnoDB
If MySQL is compiled and installed from the source code, no InnoDB engine is installed by default. therefore, in configure, add -- With-plugins = all (or Max) to support InnoDB. in MySQL, you can run the show engines command to view the storage engines supported by the current MySQL server.
Http://www.mysqlperformanceblog.com/...iled-mysql-51/

For multithreading support, you only need to select the -- with-pthread and -- enable-thread-safe-client options. The first option can indicate the use of POSIX Threads (the Unix compilation method may be somewhat different, because the Unix kernel thread working mode is significantly different from the Linux thread working mode, especially FreeBSD ).

My-small.cnf minimum configuration installation, memory <= 64 m, minimum data
My-large.cnf memory = 512 m
My-medium.cnf 32 m <memory <64 m, or memory 128 M, but the database and web server public memory
My-huge.cnf 1G <memory <2g, the server mainly runs MySQL
My-innodb-heavy-4G.cnf Max configuration installation with at least 4 GB memory

Code:
delete from mysql.user where User='';delete from mysql.user where Host='127.0.0.1';delete from mysql.user where Host='localhost.localdomain';update user set Host='%';

 

 

Mysql operation:

View mysql status:
/Etc/rc. d/init. d/mysqld status

Enable mysql
Service mysqld start

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.