Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What are the cmake methods of mysql

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)05/31 Report--

This article mainly introduces "what are the cmake methods of mysql". In the daily operation, I believe that many people have doubts about the cmake mode of mysql. The editor consulted all kinds of materials and sorted out simple and easy-to-use operation methods. I hope it will be helpful to answer the questions of "what are the cmake methods of mysql?" Next, please follow the editor to study!

It is generally divided into the following categories

Yum

Rpm package

Regular compilation and installation

Cmake installation

Binary package is installation-free

How to choose

Personal installation using yum or rpm packages

Enterprises use multi-purpose regular compilation and cmake and binary packages to avoid installation

If the quantity is small,

Version 5.1.x chooses to use regular compilation and installation

Version 5.5.x chooses to use cmake to compile and install

If there is a large quantity,

Use the binary package directly to avoid installation

First check the system environment

[root@localhost ~] # cat / etc/redhat-release CentOS release 6.5 (Final) [root@localhost ~] # uname-r2.6.32-431.el6.x86_64 [root@localhost ~] # uname-mx86_64

To install cmake software, you need to install gcc and gcc-c++

Yum-y install gccyum-y install gcc-c++

After compiling and installing cmake, you need to install the dependency package

Yum install ncurses-devel-y

Remember to install users and groups first

[root@localhost ~] # groupadd mysql

[root@localhost] # useradd mysql-s / sbin/nologin-M-g mysql

After the dependency package is installed, cd goes to the directory of mysql for cmake operation

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/tmp/mysql.sock\-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\-DWITH_FAST_MUTEXES=1\-DWITH_ZLIB=bundled\-DENABLED_LOCAL_INFILE=1\-DWITH_READLINE=1\-DWITH_EMBEDDED_SERVER=1\-DWITH_DEBUG=0\-DWITHOUT_PARTITION_STORAGE_ENGINE=1\ seems to be compiled by a 64-bit host! -DWITH_MYISAM_STORAGE_ENGINE=1\-DWITH_ARCHIVE_STORAGE_ENGINE=1\-DENABLED_LOCAL_INFILE=1\-DEXTRA_CHARSETS=all "successful execution returns the following code

Build files have been written to: / root/lamp/mysql-5.5.32

Make & & install installation completed

[100%] Built target my_safe_process # here make is complete

....

....

....

-- Installing: / application/mysql-5.5.32/support-files/solaris/postinstall-solaris # here make install is completed

Establish linkln-s / application/mysql-5.5.32/ application/mysql and establish my.cnf

[root@localhost /] # cp / application/mysql-5.5.32/support-files/my-small.cnf / etc/my.cnf

Cp: overwrite "/ etc/my.cnf"? Y

Configure environment variables

Echo 'export PATH=/application/mysql/bin:$PATH' > > / etc/profile

Tail-l / etc/profile

Source / etc/profile

Echo $PATH

Authorize chown-R mysql.mysql / application/mysql/data/chmod-R 1777 / tmp/ to initialize the db script for mysql users and mysql user groups. If there are two ok, it is proved to be successful.

[root@localhost /] # cd / application/mysql/scripts/

[root@localhost scripts] # / mysql_install_db-- basedir=/application/mysql/-- datadir=/application/mysql/data/-- user=mysql

Installing MySQL system tables...

OK

Filling help tables...

OK

Modify the hosts file vim / etc/hosts

Join www

Join mysqld script cp / root/lamp/mysql-5.5.32/support-files/mysql.server / etc/init.d/mysqld join mysqld script execution permission

Chmod + x / etc/init.d/mysqld

Execute mysqld run

[root@localhost scripts] # / etc/init.d/mysqld start

Starting MySQL... [OK]

[root@localhost scripts] # netstat-lntup | grep 3306

Tcp 0 0 0.0.0.0 3306 0.0.0.015 * LISTEN 2671/mysqld

Go to the mysql server. If you have configured the environment variable before, you can execute the mysql command mysql to delete the empty user mysql > select user,host from mysql.user.

Userhost+-+---+

Root127.0.0.1root::1

Localhostrootlocalhost

Localhost.localdomainrootlocalhost.localdomain

6 rows in set (0.00 sec)

Mysql > delete from mysql.user where user =''

Query OK, 2 rows affected (0.09 sec)

Mysql > select user,host from mysql.user

Userhost+-+---+

Root127.0.0.1root::1rootlocalhostrootlocalhost.localdomain

4 rows in set (0.00 sec)

Mysql >

Authorize the system administrator

Mysql > grant all privileges on. To system@'localhost' identified by 'longjq' with grant option

Query OK, 0 rows affected (0.00 sec)

Modify mysql password

/ application/mysql//bin/mysqladmin-u root password '123456'

/ application/mysql//bin/mysqladmin-u root-h localhost.localdomain password' new-password'

Join startup management

[root@localhost scripts] # chkconfig-- list mysqld

Mysqld 0: disable 1: disable 2: enable 3: enable 4: enable 5: enable 6: disable `

Troubleshooting

Can't log in to mysql? Delete files, reinitialize

# mysqlaccess denied for user 'localhost'.# pkill mysqld# lsof-I: 330 rm-fr / application/mysql/data/*# / application/mysql/scripts/mysql_install_db-- basedir=/application/mysql/-- datadir=/application/mysql/data/-- user=mysql

Character set error?

[root@localhost scripts] # cat / etc/sysconfig/i18n # LANG= "zh_CN.GB18030" # change it to zh_CN.UTF-8LANG= "zh_CN.UTF-8" here, and the study on "what are the cmake ways of mysql" is over. I hope I can solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report