将mysql-5.0.96-solaris10-x86_64.tar.gz复制到/opt目录下,执行以下命令:
Solaris桌面——本计算机(双击)——文件系统(双击)——opt(双击)
# groupadd mysql
# useradd -d /opt/mysql -m mysql
# cd /usr
# mkdir local
# cd local
# gunzip < /opt/mysql-5.0.96-solaris10-x86_64.tar.gz | tar -xvf -
# ln -s /usr/local/mysql-5.0.96-solaris10-x86_64 mysql
复制/usr/local/mysql/support-files/my-medium.cnf文件到/etc目录下,并更名为my.cnf.
修改my.cnf内容如下:
[client]中添加
default_character_set=utf8
[mysqld]中添加或修改
default_character_set=utf8
basedir=/usr/local/mysql
datadir=/usr/local/mysql/data
lower_case_table_names=1
max_allowed_packet=16
#(1:区分大小写,0:不区分大小写)
存盘退出,接着执行如下命令:
# cd /usr/local/mysql
# ./scripts/mysql_install_db --defaults-file=/etc/my.cnf --user=mysql
# chown -R root .
# chown -R mysql data
# chgrp -R mysql .
# bin/mysqld_safe --user=mysql &
# bin/mysqladmin -u root password 'root'
修改/etc/profile文件:在profile文件的末端加入
PATH=/usr/local/mysql/bin:$PATH; export PATH
重新启动机器,
设mysql开机自动启动mysql服务 ln -s /usr/local/mysql/support-files/mysql.server /etc/rc2.d/S60mysqld
附mysql常用命令
查看mysql版本号
# mysqladmin -uroot -proot version
关闭服务器
# mysqladmin -uroot -proot shutdown
启动服务器
# mysqld_safe --user=mysql &
登录到mysql服务器后,查看mysql编码
mysql> show global variables like 'character_set%';
Solaris桌面——本计算机(双击)——文件系统(双击)——opt(双击)
# groupadd mysql
# useradd -d /opt/mysql -m mysql
# cd /usr
# mkdir local
# cd local
# gunzip < /opt/mysql-5.0.96-solaris10-x86_64.tar.gz | tar -xvf -
# ln -s /usr/local/mysql-5.0.96-solaris10-x86_64 mysql
复制/usr/local/mysql/support-files/my-medium.cnf文件到/etc目录下,并更名为my.cnf.
修改my.cnf内容如下:
[client]中添加
default_character_set=utf8
[mysqld]中添加或修改
default_character_set=utf8
basedir=/usr/local/mysql
datadir=/usr/local/mysql/data
lower_case_table_names=1
max_allowed_packet=16
#(1:区分大小写,0:不区分大小写)
存盘退出,接着执行如下命令:
# cd /usr/local/mysql
# ./scripts/mysql_install_db --defaults-file=/etc/my.cnf --user=mysql
# chown -R root .
# chown -R mysql data
# chgrp -R mysql .
# bin/mysqld_safe --user=mysql &
# bin/mysqladmin -u root password 'root'
修改/etc/profile文件:在profile文件的末端加入
PATH=/usr/local/mysql/bin:$PATH; export PATH
重新启动机器,
设mysql开机自动启动mysql服务 ln -s /usr/local/mysql/support-files/mysql.server /etc/rc2.d/S60mysqld
附mysql常用命令
查看mysql版本号
# mysqladmin -uroot -proot version
关闭服务器
# mysqladmin -uroot -proot shutdown
启动服务器
# mysqld_safe --user=mysql &
登录到mysql服务器后,查看mysql编码
mysql> show global variables like 'character_set%';