linux 安装mysql两种方式
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
轉載于:https://www.cnblogs.com/wuzs/p/5977121.html
總結
以上是生活随笔為你收集整理的linux 安装mysql两种方式的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: C++ STL 总结
- 下一篇: Xcode 8.0 doc 注释的问题