Get the App
SLTechnology News&Howtos  ›  Database  › 

Practice of MySQL5.5 compilation installation

Shulou Source: shulou.com Published: 2022-06-01 15:17:03 09月14日 Update

Chapter 1 installation of cmake

[root@oldboy ~] # mkdir-p / home/oldboy/tools [root@oldboy ~] # cd / home/oldboy/tools/ [root@oldboy tools] # rz-y upload cmake-2.8.8.tar.gz and mysql-5.5.32.tar.gz [root@oldboy tools] # lscmake-2.8.8.tar.gz mysql-5.5.32.tar.gz [root@oldboy tools] # tar xf cmake-2.8.8.tar.gz [root@oldboy tools ] # lscmake-2.8.8 cmake-2.8.8.tar.gz mysql-5.5.32.tar.gz [root@oldboy tools] # cd cmake-2.8.8 [root@oldboy cmake-2.8.8] #. / configure finally prompts CMake has bootstrapped. Now run gmake. [root@oldboy cmake-2.8.8] # gmake [root@oldboy cmake-2.8.8] # gmake install [root@oldboy cmake-2.8.8] # cd..

Chapter II installation of MySQL

2.1 install the mysql dependency package

[root@oldboy tools] # yum install ncurses-devel-y

Pre-2.1cmake preparation work

[root@oldboy tools] # lscmake-2.8.8 cmake-2.8.8.tar.gz mysql-5.5.32.tar.gz [root@oldboy tools] # tar xf mysql-5.5.32.tar.gz [root@oldboy tools] # cd mysql-5.5.32 [root@oldboy mysql-5.5.32] # mkdir-p / application/mysql-5.5.32 [root@oldboy mysql-5.5.32] # mkdir-p / application/mysql-5. 5.32/data [root@oldboy mysql-5.5.32] # useradd mysql- s / sbin/nologin-M

Check the environment before cmake editing

Cmake. -DCMAKE_INSTALL_PREFIX=/application/mysql-5.5.32\-DMYSQL_DATADIR=/application/mysql-5.5.32/data\-DMYSQL_UNIX_ADDR=/application/mysql-5.5.32/data\-DDEFAULT_CHARSET=utf8\-DDEFAULT_COLLATION=utf8_general_ci\-DEXTRA_CHARSETS=gbk,gb2312,utf8 Ascii\-DENABLED_LOCAL_INFILE=ON\-DWITH_INNOBASE_STORAGE_ENGINE=1\-DWITH_FEDERATED_STORAGE_ENGINE=1\-DWITH_BLACKHOLE_STORAGE_ENGINE=1\-DWITHOUT_EXAMPLE_STORAGE_ENGINE=1\-DWITHOUT_PARTITION_STORAGE_ENGINE=1\-DWITH_FAST_MUTEXES=1\-DWITH_ZLIB=bundled\-DENABLED_LOCAL_INFILE=1\-DWITH_READLINE=1\-DWITH_EMBEDDED_SERVER=1\-DWITH_DEBUG=0

Make compilation & & make install installation

[root@oldboy mysql-5.5.32] # make & & make install

Make a soft connection after installation

[root@oldboy mysql-5.5.32] # ln-s / application/mysql-5.5.32/ / application/mysql [root@oldboy mysql-5.5.32] # cd. [root@oldboy tools] # lscmake-2.8.8 cmake-2.8.8.tar.gz mysql-5.5.32 mysql-5.5.32.tar.gz

Select a profile:

The test environment is small, and the production environment can be selected according to the hardware, for example: my-innodb-heavy-4G.cnf

Select a small template my-small.cnf to put into / etc/my.cnf (because it is a test environment, if the production environment, you can choose a large template)

[root@oldboy tools] # / bin/cp mysql-5.5.32/support-files/my-small.cnf / etc/my.cnf

Configure environment variables:

[root@oldboy tools] # echo 'export PATH=/application/mysql/bin:$PATH' > > / etc/profile [root@oldboy tools] # tail-1 / etc/profile [root@oldboy tools] # source / etc/profile [root@oldboy tools] # echo $PATH

Failure problem: http://oldboy.blog.51cto.com/2561410/1122867

Initialize (where it is prone to error)

[root@oldboy mysql-5.5.32] # mkdir-p / application/mysql/data/# create mysql data file directory [root@oldboy tools] # chown-R mysql.mysql / application/mysql/data/ [root@oldboy tools] # chown-R 1777 / tmp/# authorize mysql users to access mysql installation directory [root@oldboy tools] # cd / application/mysql/scripts/ [root@oldboy scripts] #. / mysql_install_db-- basedir=/application/mysql/ -- datadir=/application/mysql/data/-- user=mysql initialization marks the following two OK: WARNING: The host 'oldboy' could not be looked up with resolveip.This probably means that your libc libraries are not 100% compatiblewith this binary MySQL version. The MySQL daemon, mysqld Should worknormally with the exception that hostname resolving will not work.This means that you should use IP addresses instead of hostnameswhen specifying MySQL privileges! Installing MySQL system tables...OKFilling help tables...OK [root@oldboy scripts] # cd / home/oldboy/tools/mysql-5.5.32 [root@oldboy mysql-5.5.32] # / bin/cp support-files/mysql.server / etc/init.d/mysqld [root@oldboy mysql-5.5.32] # chmod + x / etc/init.d/mysqld [root@oldboy mysql-5.5.32] # / etc/init.d/mysqld start

Tags: Environment selection files templates directories testing production configuration compilation success two variables places failures data flags users hardware Chapter 2 questions Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Docker MariaDB Xiaomi Shulou Technology NVidia