- ubuntu 安装mysql,使用mysql-5.5.28-linux2.6-x86_64.tar.gz。先从官网下载:http://nchc.dl.sourceforge.net/project/mysql.mirror/MySQL%205.5.28/mysql-5.5.28-linux2.6-x86_64.tar.gz.
- 接下来是安装步骤,我直接贴上官方给的安装步骤:
shell> groupadd mysql shell> useradd -r -g mysql mysql shell> cd /usr/local shell> tar zxvf /path/to/mysql-VERSION-OS.tar.gz shell> ln -s full-path-to-mysql-VERSION-OS mysql shell> cd mysql shell> chown -R mysql . shell> chgrp -R mysql . shell> scripts/mysql_install_db --user=mysql shell> chown -R root . shell> chown -R mysql data shell> bin/mysqld_safe --user=mysql &
- 根据提示修改密码,mysqladmin -u root -p password ****
- 这个时候如果mysql -uroot -p(your password) 出现:command not fond ,你需要把mysql的安装地址加到PATH中,即在/etc/profile加一行:
PATH=/usr/local/php/bin:/usr/local/mysql/bin:$PATH
时间: 2024-11-06 09:40:26