- Download MySQL Community Server 5.5.8 Linux - Generic Compressed TAR Archive
- Unpack it. For example to:
/home/martin/mysql -
Create
my.cnffile in your home directory. The file contents should be:[server] user=martin basedir=/home/martin/mysql datadir=/home/martin/sql_data socket=/home/martin/socket port=3666 -
Go to the
/home/martin/mysqldirectory and execute:./scripts/mysql_install_db --defaults-file=~/my.cnf --user=martin --basedir=/home/martin/mysql --datadir=/home/martin/sql_data --socket=/home/martin/socketNote that
--defaults-fileMUST be the first parameter, otherwise it won't work! It's a MySQL bug. -
Your MySQL server is ready. Start it with this command:
./bin/mysqld_safe --defaults-file=~/my.cnf &Connecting to server:
mysql -h 127.0.0.1 -P 3666 -u root -p (using tcp)or
mysql --socket=/home/martin/socket -u root -p (using unix socket)Shutting down server:
mysqladmin -h 127.0.0.1 -P 3666 -u root shutdown(using tcp)or
mysqladmin --socket=/home/martin/socket -u root shutdown (using unix socket)
How can I install mySQL on CentOS without being root/su?
最新推荐文章于 2024-07-04 10:30:09 发布
本文指导如何在Linux上安装MySQL服务器,并配置my.cnf文件以启动和管理服务器。
3343

被折叠的 条评论
为什么被折叠?



