Operating system: ubuntu12.04LTS (64-bit): check the C compiler, C ++ compiler, make, and cmake required to compile the latest mysql version. Run the following command to check whether the compiler software is installed: dpkg & ndash; l | grepfilename to check gcc in sequence,
Operating system: ubuntu12.04LTS (64-bit)
The steps for compiling and installation are as follows:
Check the installed compilation tool
C compiler, C ++ compiler, make, and cmake required for compiling the latest mysql version.
The command to check whether the compiler software is installed is:
dpkg –l | grep filename
Check whether gcc, g ++, make, and cmake are installed in sequence.
Check whether software installed by default is available and uninstall it.
If you have installed Apache, mysql, and php, you need to stop the service and uninstall the previous software before working.
Uninstall software commands
apt-get remove –purge softnamedpkg –r xxx.deb
Compile and install libxml2
: Libxml2-2.9.0.tar.gz
Ftp: ftp://xmlsoft.org/libxml2/
You can also download it through git:
git clone git://git.gnome.org/libxml2
cd /usr/local/srctar –zvxf libxml2-2.9.0.tar.gzcd libxml2-2.9.0./configure –prefix=/usr/local/libxml2makesudo make install
Compile and install libmcrypt
: Libmcrypt-2.5.7.tar.gz
Remote download: http://tcpdiag.dl.sourceforge.net/project/mcrypt/Libmcrypt/Production/libmcrypt-2.5.7.tar.gz
cd /usr/local/srctar –zvxf libmcrypt-2.5.7.tar.gzcd libmcrypt-2.5.7./configure --prefix=/usr/local/libmcryptmakesudo make install
Compile and install zlib
: Zlib-1.2.8.tar.gz
Remote download: http://hivelocity.dl.sourceforge.net/project/libpng/zlib/1.2.8/zlib-1.2.8.tar.gz
cd /usr/local/srctar –zvxf zlib-1.2.8.tar.gzcd zlib-1.2.8./configuremakesudo make install
Note that the installation path of the zlib library cannot be specified during installation; otherwise, the zlib location cannot be found during the installation of the library, and the path manually specified cannot be solved.
Install libpng Library
: Libpng-1.6.7.tar.gz
Original Download: http://iweb.dl.sourceforge.net/project/libpng/libpng16/older-releases/1.6.7/libpng-1.6.7.tar.gz
cd /usr/local/srctar –zvxf libpng-1.6.7.tar.gzcd libpng-1.6.7./configure --prefix=/usr/local/libpngmakesudo make install
If a specific installation path is specified for the zlib library in the previous step, the system will prompt zlib that there is no installation problem during configure, and return to the zlib source code for execution.
Make clean re-compile and install
Install iis6
: Repeated src.v6b.tar.gz
Remote download: http://www.ijg.org/files/
You need to manually create the directory required for installation. it cannot be automatically created during installation.
mkdir /usr/local/jpeg6mkdir /usr/local/jpeg6/binmkdir /usr/local/jpeg6/libmkdir /usr/local/jpeg6/includemkdir –p /usr/local/jpeg6/man/man1cd /usr/local/srctar –zvxf jpegsrc.v6b.tar.gzcd jpeg-6b./configure --prefix=/usr/local/jpeg6 –enable-shared –enable-staticmakesudo make install
Possible error: make:./libtool: command not found (solution reference this article: Linux installation jpeg-6b error:./libtool command not found)
Install freetype
: Freetype-2.4.10.tar.gz
Remote download 1: http://download.savannah.gnu.org/releases/freetype/
Remote download 2: http://colocrossing.dl.sourceforge.net/project/freetype/freetype2/2.4.10/freetype-2.4.10.tar.gz
cd /usr/local/srctar –zvxf freetype-2.4.10.tar.gzcd freetype-2.4.10./configure --prefix=/usr/local/freetypemakesudo make install
For error information and solutions, refer to this article: how to compile and install freetype in Linux and how to solve the error. This article: make: [install] Error 1 (ignore) and how to solve the error.
Install the autoconf Library
: Autoconf-2.68.tar.gz
Remote download: http://ftp.gnu.org/gnu/autoconf/
To install autoconf, you need to install m4 software. otherwise, configure will not pass, and it is best to install it by default without specifying the prefix. Otherwise, it will be troublesome to install php extensions later.
cd /usr/local/srctar –zvxf autoconf-2.68.tar.gzcd autoconf-2.68./configuremakesudo make install
Install the gd Library
: Gd-2.0.35.tar.gz
Remote download: http://ring.u-toyama.ac.jp/archives/graphics/gd/
cd /usr/local/srctar –zvxf gd-2.0.35.tar.gzcd gd-2.0.35./configure --prefix=/usr/local/gd2 --with-jpeg=/usr/local/jpeg6 --with-png=/usr/local/libpng --with-freetype=/usr/local/freetypemakesudo make install
When installing the gd Library, the png library cannot be found. in this case, you need to manually modify the gd_png.c file and find
# Include "png. h"
Change it to the actual png Library location (find it in the libpng installation directory, in this example/usr/local/libpng/include/png. h)
Install the Apache server
: Httpd-2.2.26.tar.gz
Remote download: http://httpd.apache.org/download.cgi#apache22
cd /usr/local/srctar –zvxf httpd-2.2.26.tar.gzcd httpd-2.2.26./configure --prefix=/usr/local/apache2 --sysconfdir=/etc/httpd --with-include-apr --disable-userdir --enable-so --enable-deflate=shared --enable-expires=shared --enable-rewrite=shared --enable-static-supportmakesudo make install
When installing Apache, the dependent libraries may occur. you need to install apr and apr-util in advance. the installation method of pcre is normal compilation and installation (refer to this article: Use source code compilation and installation of apache2.2.26 in Ubuntu)
Enable apache service
cp /usr/local/apache2/bin/apachectl /sbin/apachectl startnetstat -tnl | grep 80vim /etc/rc.loacl
Install mysql database
: Mysql-5.5.25a.tar.gz
Remote download: http://downloads.sourceforge.net/project/mysql.mirror/MySQL%205.5.25a/mysql-5.5.25a.tar.gz? R = http % 3A % 2F % 2Fsourceforge.net % 2 Fprojects % 2Fmysql. mirror % 2 Ffiles % 2 FMySQL % 25205.25a % 2F & ts = 1393564528 & use_mirror = hivelocity
cd /usr/local/srctar –zvxf mysql-5.5.25a.tar.gzcd mysql-5.5.25acmake -DCMAKE_INSTALL_PREFIX=/usr/local/mysql -DMYSQL_DATADIR=/usr/local/mysql/data -DEXTRA_CHARSETS=all -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci -DWITH_READLINE=1 -DWITH_SSL=bundled -DWITH_EMBEDDED_SERVER=1 -DENABLED_LOCAL_INFILE=1 -DWITH_INNOBASE_STORAGE_ENGINE=1 -DWITHOUT_PARTITION_STORAGE_ENGINE=1 -DWITH_DEBUG=0makesudo make install
For installation errors and solutions, refer to this article: Ubuntu12.04 compilation and installation of MySQL 5 errors and solutions
Create a mysql User
groupadd mysqluseradd -r -g mysql mysql
Permission settings and authorization table installation
cd /usr/local/mysqlchown -R mysql .chgrp -R mysql .scripts/mysql_install_db --user=mysqlchown -R root .chown -R mysql data
Create a configuration file
cp support-files/my-medium.cnf /etc/my.cnf
Start mysql service
bin/mysqld_safe --user=mysql&netstat -tnl | grep 3306
Configure mysql service
cp support-files/mysql.server /etc/init.d/mysqlsudo update-rc.d mysql defaultschkconfig --add mysqlchkconfig mysql on
User Account Control
bin/mysql -urootmysql> DELETE FROM mysql.user WHERE Host='localhost' AND User='';mysql>SET PASSWORD FOR 'root'@'localhost'=PASSWORD('123456');
Startup error: unable to start Couldn't find MySQL server (/usr/bin/mysqld_safe )"
sudo rm?/etc/mysql/my.cnf
You can.
Install PHP5.3
: Php-5.3.28.tar.gz
Remote download 1: http://php.net/downloads.php
Remote download 2: http://mirrors.sohu.com/php/
cd /usr/local/srctar –zvxf php-5.3.28.tar.gzcd php-5.3.28./configure --prefix=/usr/local/php --with-config-file-path=/usr/local/php/etc --with-apxs2=/usr/local/apache2/bin/apxs --with-pdo-mysql=/usr/local/mysql --with-mysql=/usr/local/mysql --with-mysqli=/usr/local/mysql/bin/mysql_config --with-libxml-dir=/usr/local/libxml2 --with-png-dir=/usr/local/libpng --with-jpeg-dir=/usr/local/jpeg6 --with-freetype-dir=/usr/local/freetype --with-gd=/usr/local/gd2 --with-mcrypt=/usr/local/libmcrypt --enable-soap --enable-mbstring=all --enable-socketsmakesudo make install
In PHP5.4 make, a problem occurs.
We need to modify the include/gd_io.h under the gd Library Directory.
vi
/include/gd_io.h
Add void * data in the gdIOCtx structure;
The format is as follows:
typedef struct gdIOCtx{ int (*getC) (struct gdIOCtx *); int (*getBuf) (struct gdIOCtx *, void *, int); void (*putC) (struct gdIOCtx *, int); int (*putBuf) (struct gdIOCtx *, const void *, int); /* seek must return 1 on SUCCESS, 0 on FAILURE. Unlike fseek! */ int (*seek) (struct gdIOCtx *, const int); long (*tell) (struct gdIOCtx *); void (*gd_free) (struct gdIOCtx *); void (*data);}gdIOCtx;
Create a PHP configuration file
cp php.ini-development /usr/local/php/etc/php.ini
Add apache support for PHP
vi /etc/httpd/httpd.confAddtype application/x-httpd-php .php .phtmlsudo apachectl stopsudo apachectl start
Create phpinfo. php in the Apache web root directory
Test whether the environment is successfully installed
Basically, the installation is complete.
Install and configure phpMyAdmin:
: PhpMyAdmin-4.1.1-all-languages.zip
Remote download: http://www.phpmyadmin.net/home_page/downloads.php
Unzip? PhpMyAdmin-4.1.1-all-languages.zipmv? PhpMyAdmin-4.1.1-all-languages phpmyadminmv phpmyadmin/var/www/(assuming/var/www is the web root directory) cd/var/www/phpmyadmincp config. sample. inc. php config. inc. php
Then, you can access phpmyadmin through http: // localhost/phpMyAdmin in the browser.