Compile and install MySQL binary files in Debian

Source: Internet
Author: User
Tags pkill

Record: Abnormal

 

1. Make preparations for installation and use...

 

Linux Code
    1. # binary file ( if you provide your own files, be sure not to make the version wrong because I am not familiar with it.
    2. This problem has occurred
    3. )
    4. wget http://dev.mysql.com/get/Downloads/MySQL- 5.5/mysql-5.5.12.tar.gz/from/http://mysql.he.net/
    5. # cmake compilation
    6. wget http://www.cmake.org/files/v2. 8/cmake-2.8.4.tar.gz
    7. wget http://ftp.gnu.org/gnu/bison/bison- 2.4.3.tar.gz
    8. apt-Get install make // the network resource address is not found.
# Binary files (If you provide your own files, be sure not to make the version wrong, because I am not very familiar with it and have encountered this problem.Wget http://dev.mysql.com/get/Downloads/MySQL-5.5/mysql-5.5.12.tar.gz/from/http://mysql.he.net/ # cmake compile wget http://www.cmake.org/files/v2.8/cmake-2.8.4.tar.gz wget http://ftp.gnu.org/gnu/bison/bison-2.4.3.tar.gz apt-Get install make // network resource address not found leave

 

2. Install cmake

 

Linux code
    1. CD/usr/local/
    2. Tar zxvf cmake-2.8.4.tar.gz // download the cmake file path
    3. CD cmake-2.8.4
    4. ./Bootstrap
    5. Make
    6. Make install
 
CD/usr/local/tar zxvf cmake-2.8.4.tar.gz // download the cmake file path to CD cmake-2.8.4./Bootstrap make install

 

3. Install bison

 

Linux code
    1. Tar zxvf bison-2.4.3.tar.gz
    2. CD bison-2.4.3
    3. ./Configure
    4. Make
    5. Make install
 
Tar zxvf bison-2.4.3.tar.gz CD bison-2.4.3./configure make install


Exception Code
    1. 1. Configure: Error: no acceptable C compiler found in $ path
    2. Cause: the GCC compiler is not installed.
    3. Solution: APT-Get install gcc
1. Configure: Error: no acceptable C compiler found in $ path cause: GCC compiler is not installed. Solution: APT-Get install gcc

 

4. Compile and install MySQL

 

# Create a user

 

Linux code
  1. Groupadd MySQL
  2. Useradd-G MySQL
  3. CD/usr/local
  4. Tar zxvf ../MySQL-5.5.12.tar.gz // put the binary file under/usr.
  5. CD mysql-5.5.12
  6. # Compile a binary file
  7. Cmake-dcmake_install_prefix =/usr/local/MySQL \
  8. -Dmysql_unix_addr =/tmp/MySQL. Sock \
  9. -Ddefault_charset = utf8 \
  10. -Ddefault_collation = utf8_general_ci \
  11. -Dwith_extra_charsets: String = utf8, GBK \
  12. -Dwith_myisam_storage_engine =1 \
  13. -Dwith_innobase_storage_engine =1 \
  14. -Dwith_memory_storage_engine =1 \
  15. -Dwith_readline =1 \
  16. -Denabled_local_infile =1 \
  17. -Dmysql_datadir =/var/MySQL/data \
  18. -Dmysql_user = MySQL
  19. Make // This step takes a long time (the package of this file contains cmakelists.txt)
  20. Make install
 
Groupadd MySQL useradd-G MySQL CD/usr/local tar zxvf .. /mysql-5.5.12.tar.gz // I put the binary file under/usr CD mysql-5.5.12 # compile the binary file cmake-dcmake_install_prefix =/usr/local/MySQL \-dmysql_unix_addr =/tmp/MySQL. sock \-ddefault_charset = utf8 \-ddefault_collation = utf8_general_ci \-dwith_extra_charsets: String = utf8, GBK \-records = 1 \-records = 1 \-records = 1 \-dwith_readline = 1 \-denabled_local_infile = 1 \-dmysql_datadir =/var/MySQL/data \-dmysql_user = mySQL make // This step takes a long time (the package of this file contains cmakelists.txt) make install

 

# Modifying users and permissions

 

Java code
    1. /Usr/sbin/groupadd MySQL
    2. /Usr/sbin/useradd-G MySQL
    3. Chmod + w/usr/local/MySQL
    4. Chown-r MYSQL: MySQL/usr/local/MySQL
    5. Mkdir-P/var/MySQL/
    6. Mkdir-P/var/MySQL/data/
    7. Mkdir-P/var/MySQL/log/
    8. Chown-r MYSQL: MySQL/var/MySQL/
    9. CD support-files/
    10. CP my-large.cnf/var/MySQL/My. CNF (for Debian, my. conf needs to be placed under/etc/MySQL)
    11. CP mysql. Server/etc/init. d/mysqld
/Usr/sbin/groupadd MySQL/usr/sbin/useradd-G MySQL chmod + w/usr/local/MySQL chown-r MYSQL: mySQL/usr/local/MySQL mkdir-P/var/MySQL/data/mkdir-P/var/MySQL/log/chown-r MYSQL: mySQL/var/MySQL/CD support-files/CP my-large.cnf/var/MySQL/My. CNF (for Debian, my. conf needs to be placed under/etc/MySQL/) CP MySQL. server/etc/init. d/mysqld

 

Exception Code
    1. 2. Fatal error: cocould not find mysqld (the command prompt is not too clear, that is, the mysqld command cannot be found)
    2. Solution ln-SF/usr/local/MySQL/bin/*/usr/bin
 
2. fatal error: cocould not find mysqld (the command prompt is not clear, that is, the mysqld command cannot be found) solution ln-SF/usr/local/MySQL/bin/*/usr/bin

 

Exception Code
    1. 3 fatal error: cocould not find errmsg. sys
    2. Cause: the file cannot be accessed under a specific path. If you just copy the file, the following will appear:
    3. The same problem occurs because it depends on the/usr/local/MySQL/share folder and I copied it directly or created a soft connection.
    4. Solution
    5. CD/usr/share/
    6. Mkdir MySQL
    7. CD MySQL
    8. CP-A/usr/local/MySQL/share /*.
 
3 fatal error: cocould not find errmsg. SYS: the file cannot be accessed under a specific path. If you just copy the file, the same problem may occur below, because it depends on the/usr/local/MySQL/share folder, I copied it directly, or create a soft connection solution CD/usr/share/mkdir MySQL CD MySQL CP-A/usr/local/MySQL/share /*.

 

Exception Code
    1. 4/usr/bin/mysqld: Error while loading shared libraries: libaio. so.1: cannot open shared object
    2. file: no such file or directory
    3. install libaio-dev
    4. tips
    5. NO apt-Get update was found when I searched for the reason on the Internet, so the uninformed apt-Get update fuck is invalid, write Article
    6. for details, this Linux apprentice shows that the workload is very high
    7. go to the following URL and follow the prompts to modify/etc/APT/sources. List
    8. http://packages.debian.org/zh-cn/lenny/i386/libaio-dev/download
    9. after writing, go to Apt-Get update
    10. # installation
    11. apt-Get install libaio-dev
4/usr/bin/mysqld: Error while loading shared libraries: libaio. so.1: cannot open shared object file: no such file or directory when installing libaio-dev tips on the Internet to find the cause, it is said that there is no apt-Get update, so the ignorant apt-Get update fuck is invalid. To write an article in detail, I am a Linux apprentice, which indicates that the pressure is great to go to the following URL and follow the prompts to modify/etc/APT/sources. list http://packages.debian.org/zh-cn/lenny/i386/libaio-dev/download after writing in apt-Get update # Install apt-Get install libaio-Dev

 

Exception Code
    1. 5. 110518 15:09:27 [Error]/usr/local/MySQL/bin/mysqld: Unknown option '-- skip-bdb'
    2. Solution Vim/etc/MySQL/My. CNF comment out the line skip-bdb
5. 110518 15:09:27 [Error]/usr/local/MySQL/bin/mysqld: Unknown option '-- skip-bdb' solution Vim/etc/MySQL/My. CNF comment out the line skip-bdb
Linux code
    1. CARY:/usr/local/MySQL # scripts/mysql_install_db -- datadir =/var/MySQL/data/-- basedir =/usr/local/MySQL
    2. -- User = MySQL
 
CARY:/usr/local/MySQL # scripts/mysql_install_db -- datadir =/var/MySQL/data/-- basedir =/usr/local/MySQL -- user = MySQL

 

Start Database

 

Linux code
    1. /Etc/init. d/mysqld start

 

Exception Code
    1. This is the exception information I have simulated
    2. /etc/init. d/mysqld: Line 276: CD:/usr/local/mysq1l: no such file or directory
    3. solution: in VIM/etc/MySQL/My. CNF, the configuration parameters of mysqld must be consistent with those installed above.
    4. for example, in my. CNF
    5. [mysqld]
    6. ...
    7. change the basedir =/usr/local/mysq1l parameter to/usr/local/MySQL configured above.
This is my simulated exception information/etc/init. d/mysqld: Line 276: CD:/usr/local/mysq1l: no such file or directory solution Vim/etc/MySQL/My. in CNF, the configuration parameters of mysqld must be consistent with the configuration parameters you installed above, as shown in my. [mysqld]... change the basedir =/usr/local/mysq1l parameter to/usr/local/MySQL

Change administrator password

 

Java code
    1. Mysqladmin-uroot password '123'
 
Mysqladmin-uroot password '123'

 

 

Exception Code
    1. Starting MySQL... the server quit without updating PID file (/var/run/mysqld. PID). failed!
    2. Solution
    3. Pkill-F MySQL
    4. Rm/var/run/MySQL /*
    5. Restart MySQL
 
Starting MySQL... the server quit without updating PID file (/var/run/mysqld. PID). failed! Solution: pkill-F MySQL RM/var/run/MySQL/* restart MySQL

 

: If the downloaded file is a compiled file, you can skip this step without cmake compilation.

 

 

Cannot create a remote user to log on ??

 

Vim/etc/MySQL/My. CNF

 

Comment out bind-address 127.0.0.1

Related Article

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.