linux 安装mysql两种方式
阅读原文时间:2024年06月12日阅读:2

yum -y install gcc gcc-c++ ncurses-devel cmake  bison   zlib    zlib-devel libxml  openssl   dtrace

解压并安装MySQL

# tar zxvf mysql-5.6.12.tar.gz

# cd mysql-5.6.12

# cmake ./

# -DCMAKE_INSTALL_PREFIX=/usr/local/mysql          \    #安装路径

# -DMYSQL_DATADIR=/usr/local/mysql/data            \    #数据文件存放位置

# -DSYSCONFDIR=/etc                                \    #my.cnf路径

# -DWITH_MYISAM_STORAGE_ENGINE=1                   \    #支持MyIASM引擎

# -DWITH_INNOBASE_STORAGE_ENGINE=1                 \    #支持InnoDB引擎

# -DWITH_MEMORY_STORAGE_ENGINE=1                   \    #支持Memory引擎

# -DWITH_READLINE=1                                \    #快捷键功能(我没用过)

# -DMYSQL_UNIX_ADDR=/tmp/mysqld.sock               \    #连接数据库socket路径

# -DMYSQL_TCP_PORT=3306                            \    #端口

# -DENABLED_LOCAL_INFILE=1                         \    #允许从本地导入数据

# -DWITH_PARTITION_STORAGE_ENGINE=1                \    #安装支持数据库分区

# -DEXTRA_CHARSETS=all                             \    #安装所有的字符集

# -DDEFAULT_CHARSET=utf8                           \    #默认字符

# -DDEFAULT_COLLATION=utf8_general_ci

更多详细参数可参考 http://dev.mysql.com/doc/refman/5.5/en/source-configuration-options.html

glibc安装成功后

To start mysqld at boot time you have to copy
support-files/mysql.server to the right place for your system

PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:

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

Alternatively you can run:

./bin/mysql_secure_installation

which will also give you the option of removing the test
databases and anonymous user created by default. This is
strongly recommended for production servers.

See the manual for more instructions.

You can start the MySQL daemon with:

cd . ; ./bin/mysqld_safe &

You can test the MySQL daemon with mysql-test-run.pl

cd mysql-test ; perl mysql-test-run.pl

Please report any problems at http://bugs.mysql.com/

The latest information about MySQL is available on the web at

http://www.mysql.com

Support MySQL by buying support/licenses at http://shop.mysql.com

New default config file was created as ./my.cnf and
will be used by default by the server when you start it.
You may edit this file to change server settings

手机扫一扫

移动阅读更方便

阿里云服务器
腾讯云服务器
七牛云服务器

你可能感兴趣的文章