Install mysql 5.5 and mysql5.5 in linux source code
Today, in ubuntu and CentOS, mysql has been installed many times with the source code, so remember it before you forget it... There is no difference in the installation process in ubuntu and CentOS. 0. download the source code and upload it to the server. run apt-get install cmake and apt-get install libncurse in cmake and libncurse ubuntu to install CentOS and run yum-y install ncurses-devel and yum-y install cmake. In some versions, yum-y install cmake28.x86 _ 64 2. create a mysql user groupadd mysql useradd mysql-g mysql-s/sbin/nologin 3. create the installation directory and authorize mkdir-p/usr/local/mysql/data chown-R mysql. mysql/usr/local/mysql 4. unzip and install tar zxvf mysql-5.5.47.tar.gz cd mysql-5.5.47 mkdir build # create a build File to separate the source code and compiled files, file query is more convenient. Cd build cmake28 .. -DCMAKE_INSTALL_PREFIX =/usr/local/mysql \ # installation directory-DMYSQL_UNIX_ADDR =/usr/local/mysql. sock \ # socket path used-DDEFAULT_CHARSET = utf8 \ # specify the default server Character Set-DDEFAULT_COLLATION = utf8_general_ci \ # specify the default server verification rules-DWITH_EXTRA_CHARSETS: STRING = utf8, gbk \ # install the required Character Set-DWITH_INNOBASE_STORAGE_ENGINE = 1 \ # InnoDB Engine-DWITH_READLINE = 1 \-DENABLED_LOCAL_INFILE = 1 \ # specify whether local load data infile-DMYSQL_DATADIR =/usr /local/mysql/data/\ # data storage location-DMYSQL_TCP_PORT = 3306 # default port make & make install 5. add the mysql configuration file to cp support-files/my-small.cnf/etc/my. cnf # mysql configuration file chmod 755 scripts/mysql_install_db # execution permission scripts/mysql_install_db -- user = mysql -- basedir =/usr/local/mysql -- datadir =/usr/local/mysql/data /# initialize cp support-files/mysql. server/etc/init. d/mysqld # start the program chmod 755/etc/init. d/mysqld # execution permission 6. start service mysqld start 7. add password/usr/local/mysql/bin/mysqladmin-u root password 'passwd'