在slackware上安装mysql出现问题,请帮忙。
时间:2004-03-03
来源:互联网
1、用instalpkg 安装时如何指定(想要)程序安装路径?
2、安装完成后初始化的步骤,大家能不能说说呢?
2、安装完成后初始化的步骤,大家能不能说说呢?
作者: 海中鸯 发布时间: 2004-03-03
别用slack的pkg包安装,到http://www.mysql.com 下载一个bin或者src安装。可以指定目录安装。具体可以看mysql的安装文档。
作者: struggle 发布时间: 2004-03-03
http://www.linuxsir.org/bbs/showthre...threadid=90024
作者: windrose 发布时间: 2004-03-03
The basic commands you must execute to install and use a MySQL binary distribution are:
shell> groupadd mysql
shell> useradd -g mysql mysql
shell> cd /usr/local
shell> gunzip < /path/to/mysql-VERSION-OS.tar.gz | tar xvf -
shell> ln -s full-path-to-mysql-VERSION-OS mysql
shell> cd mysql
If you would like to use mysqlaccess and have the MySQL distribution in some non-standard place, you must change the location where mysqlaccess expects to find the mysql client. Edit the `bin/mysqlaccess' script at approximately line 18. Search for a line that looks like this:
$MYSQL = '/usr/local/bin/mysql'; # path to mysql executable
Change the path to reflect the location where mysql actually is stored on your system. If you do not do this, you will get a Broken pipe error when you run mysqlaccess.
shell> scripts/mysql_install_db
shell> chown -R root .
shell> chown -R mysql data
shell> chgrp -R mysql .
cp support-files/my-medium.cnf /etc/my.cnf#二进制发行版可能不需要
shell> bin/safe_mysqld --user=mysql &
or
shell> bin/mysqld_safe --user=mysql &
if you are running MySQL 4.x
6) 为 root 设置密码
/usr/local/mysql/bin/mysqladmin -u root -p password your_new_password
注意,第一个 password 是命令的参数,依原样键入,而 your_new_password 就是你要设置的新密码。例如,要将 root 密码设为123456,那么这样输入命令:
/usr/local/mysql/bin/mysqladmin -u root -p password 123456
回车后系统会提示你输入当前密码,应该是像下面这样:
Enter password:
因为此时还没有密码,所以直接回车即可,这时没有任何提示返回提示符状态,而密码已经设置完成。此时可以通过关闭 MySQL 服务验证密码是否生效:
/usr/local/mysql/bin/mysqladmin -u root -p shutdown
Enter password:123456
系统提示 MySQL 已关闭:
020531 13:14:35 mysql ended
[1]+ Done /usr/local/mysql/bin/safe_mysqld --user=mysql
If you would like MySQL to start automatically when you boot your machine, you can copy support-files/mysql.server to the location where your system has its startup files. More information can be found in the support-files/mysql.server script itself and in section 2.4.3 Starting and Stopping MySQL Automatically.
# Usually this is put in /etc/init.d (at least on machines SYSV R4 based
# systems) and linked to /etc/rc3.d/S99mysql and /etc/rc0.d/K01mysql.
# When this is done the mysql server will be started when the machine is
# started and shut down when the systems goes down.
You need to add these start and stop commands to the appropriate places in your `/etc/rc*' files when you want to start up MySQL automatically on your server.
On most current Linux distributions, it is sufficient to copy the file mysql.server into the `/etc/init.d' directory (or `/etc/rc.d/init.d' on older Red Hat systems). Afterwards, run the following command to enable the startup of MySQL on system bootup:
shell> chkconfig --add mysql.server
As an alternative to the above, some operating systems also use `/etc/rc.local' or `/etc/init.d/boot.local' to start additional services on bootup. To start up MySQL using this method, you could append something like the following to it:
/bin/sh -c 'cd /usr/local/mysql ; ./bin/safe_mysqld --user=mysql &'
You can also add options for mysql.server in a global `/etc/my.cnf' file. A typical `/etc/my.cnf' file might look like this:
[mysqld]
datadir=/usr/local/mysql/var
socket=/var/tmp/mysql.sock
port=3306
user=mysql
[mysql_server]
basedir=/usr/local/mysql
The mysql.server script understands the following options: datadir, basedir, and pid-file.
shell> groupadd mysql
shell> useradd -g mysql mysql
shell> cd /usr/local
shell> gunzip < /path/to/mysql-VERSION-OS.tar.gz | tar xvf -
shell> ln -s full-path-to-mysql-VERSION-OS mysql
shell> cd mysql
If you would like to use mysqlaccess and have the MySQL distribution in some non-standard place, you must change the location where mysqlaccess expects to find the mysql client. Edit the `bin/mysqlaccess' script at approximately line 18. Search for a line that looks like this:
$MYSQL = '/usr/local/bin/mysql'; # path to mysql executable
Change the path to reflect the location where mysql actually is stored on your system. If you do not do this, you will get a Broken pipe error when you run mysqlaccess.
shell> scripts/mysql_install_db
shell> chown -R root .
shell> chown -R mysql data
shell> chgrp -R mysql .
cp support-files/my-medium.cnf /etc/my.cnf#二进制发行版可能不需要
shell> bin/safe_mysqld --user=mysql &
or
shell> bin/mysqld_safe --user=mysql &
if you are running MySQL 4.x
6) 为 root 设置密码
/usr/local/mysql/bin/mysqladmin -u root -p password your_new_password
注意,第一个 password 是命令的参数,依原样键入,而 your_new_password 就是你要设置的新密码。例如,要将 root 密码设为123456,那么这样输入命令:
/usr/local/mysql/bin/mysqladmin -u root -p password 123456
回车后系统会提示你输入当前密码,应该是像下面这样:
Enter password:
因为此时还没有密码,所以直接回车即可,这时没有任何提示返回提示符状态,而密码已经设置完成。此时可以通过关闭 MySQL 服务验证密码是否生效:
/usr/local/mysql/bin/mysqladmin -u root -p shutdown
Enter password:123456
系统提示 MySQL 已关闭:
020531 13:14:35 mysql ended
[1]+ Done /usr/local/mysql/bin/safe_mysqld --user=mysql
If you would like MySQL to start automatically when you boot your machine, you can copy support-files/mysql.server to the location where your system has its startup files. More information can be found in the support-files/mysql.server script itself and in section 2.4.3 Starting and Stopping MySQL Automatically.
# Usually this is put in /etc/init.d (at least on machines SYSV R4 based
# systems) and linked to /etc/rc3.d/S99mysql and /etc/rc0.d/K01mysql.
# When this is done the mysql server will be started when the machine is
# started and shut down when the systems goes down.
You need to add these start and stop commands to the appropriate places in your `/etc/rc*' files when you want to start up MySQL automatically on your server.
On most current Linux distributions, it is sufficient to copy the file mysql.server into the `/etc/init.d' directory (or `/etc/rc.d/init.d' on older Red Hat systems). Afterwards, run the following command to enable the startup of MySQL on system bootup:
shell> chkconfig --add mysql.server
As an alternative to the above, some operating systems also use `/etc/rc.local' or `/etc/init.d/boot.local' to start additional services on bootup. To start up MySQL using this method, you could append something like the following to it:
/bin/sh -c 'cd /usr/local/mysql ; ./bin/safe_mysqld --user=mysql &'
You can also add options for mysql.server in a global `/etc/my.cnf' file. A typical `/etc/my.cnf' file might look like this:
[mysqld]
datadir=/usr/local/mysql/var
socket=/var/tmp/mysql.sock
port=3306
user=mysql
[mysql_server]
basedir=/usr/local/mysql
The mysql.server script understands the following options: datadir, basedir, and pid-file.
作者: dato 发布时间: 2004-03-03
谢谢各位了。
作者: 海中鸯 发布时间: 2004-03-08
相关阅读 更多
热门阅读
-
office 2019专业增强版最新2021版激活秘钥/序列号/激活码推荐 附激活工具
阅读:74
-
如何安装mysql8.0
阅读:31
-
Word快速设置标题样式步骤详解
阅读:28
-
20+道必知必会的Vue面试题(附答案解析)
阅读:37
-
HTML如何制作表单
阅读:22
-
百词斩可以改天数吗?当然可以,4个步骤轻松修改天数!
阅读:31
-
ET文件格式和XLS格式文件之间如何转化?
阅读:24
-
react和vue的区别及优缺点是什么
阅读:121
-
支付宝人脸识别如何关闭?
阅读:21
-
腾讯微云怎么修改照片或视频备份路径?
阅读:28