安装mysql 5.0.4的过程笔记
新增用户组 groupadd mysql
新增用户:useradd -g mysql mysql
解压 tar -zxvf mysql-5.0.4...
配置 ./configure --prefix=/usr/local/msyql --with-extra-charsets=all
make && make install
拷贝配置文件 cp /opt/lamp_src/mysql-5.0.4../support-files/my-medium.cnf /etc/my.cnf
安装数据库 /usr/local/mysql/bin/mysql_install_db --user=mysql
更改安装目录的所属用户
chown -R root /usr/local/mysql
chown -R mysql /usr/local/mysql/var
chown -R mysql /usr/local/mysql
chgrp -R mysql /usr/local/mysql
查看用户组和用户是否都已改成mysql组和mysql用户
ls -ld /usr/local/mysql/
ls -ld /usr/local/mysql/var/
启动mysql
/usr/local/mysql/bin/mysqld_safe --user=mysql &
查看进程和端口验证是否启动
ps -le |grep mysqld
netstat -an |grep 3306
查看mysql信息
/usr/local/mysql/bin/mysqladmin variables
登陆mysql
/usr/local/mysql/bin/mysql -u root
进入mysql后修改mysql用户root的密码
SET PASSWORD FOR 'root'@'localhost'=PASSWORD('123456');
退出mysql
exit
设置mysql与系统自启动
方法1:直接写启动命令到rc.local文件里
echo "/usr/local/apache/bin/apachectl start" >> /etc/rc.d/rc.local
方法2:拷贝启动文件到init.d文件夹并命名为mysqld
cp /opt/lamp_src/mysql-5.0.41/support-files/mysql.server /etc/init.d/mysqld
把mysqld纳入到系统的chkconfig管理体系中
chkconfig --add mysqld
查看mysql运行级别的启动状态,默认运行级别是12345级
chkconfig --list mysqld
修改(关闭)mysql的245运行级别,只留下3级
chkconfig --levels 245 mysqld off
完成
新增用户组 groupadd mysql
新增用户:useradd -g mysql mysql
解压 tar -zxvf mysql-5.0.4...
配置 ./configure --prefix=/usr/local/msyql --with-extra-charsets=all
make && make install
拷贝配置文件 cp /opt/lamp_src/mysql-5.0.4../support-files/my-medium.cnf /etc/my.cnf
安装数据库 /usr/local/mysql/bin/mysql_install_db --user=mysql
更改安装目录的所属用户
chown -R root /usr/local/mysql
chown -R mysql /usr/local/mysql/var
chown -R mysql /usr/local/mysql
chgrp -R mysql /usr/local/mysql
查看用户组和用户是否都已改成mysql组和mysql用户
ls -ld /usr/local/mysql/
ls -ld /usr/local/mysql/var/
启动mysql
/usr/local/mysql/bin/mysqld_safe --user=mysql &
查看进程和端口验证是否启动
ps -le |grep mysqld
netstat -an |grep 3306
查看mysql信息
/usr/local/mysql/bin/mysqladmin variables
登陆mysql
/usr/local/mysql/bin/mysql -u root
进入mysql后修改mysql用户root的密码
SET PASSWORD FOR 'root'@'localhost'=PASSWORD('123456');
退出mysql
exit
设置mysql与系统自启动
方法1:直接写启动命令到rc.local文件里
echo "/usr/local/apache/bin/apachectl start" >> /etc/rc.d/rc.local
方法2:拷贝启动文件到init.d文件夹并命名为mysqld
cp /opt/lamp_src/mysql-5.0.41/support-files/mysql.server /etc/init.d/mysqld
把mysqld纳入到系统的chkconfig管理体系中
chkconfig --add mysqld
查看mysql运行级别的启动状态,默认运行级别是12345级
chkconfig --list mysqld
修改(关闭)mysql的245运行级别,只留下3级
chkconfig --levels 245 mysqld off
完成