米葫芦网

LNMP中安装mysql5的一些问题及解决

热度:11℃ 发布时间:2023-11-16 20:07:29

[root@localhost mysql-5.0.40]# cp /usr/local/mysql/share/mysql/my-medium.cnf /etc/my.cnf
[root@localhost mysql-5.0.40]# cd /usr/local/mysql/bin
[root@localhost bin]# ./mysql_install_db
[root@localhost bin]# cd ..
[root@localhost mysql]# ls
bin include info lib libexec man mysql-test share sql-bench var
[root@localhost mysql]# cd var
[root@localhost var]# ls
mysql mysql-bin.000001 mysql-bin.000002 mysql-bin.index test
[root@localhost var]# cd ..
[root@localhost mysql]# /usr/local/mysql/bin/mysqld
mysqld_multi mysqld_safe mysqldump mysqldumpslow
[root@localhost mysql]# /usr/local/mysql/bin/mysqld_safe &
[2] 23080
[root@localhost mysql]# chown: ‘mysql’: 无效的用户
Starting mysqld daemon with databases from /usr/local/mysql/var
STOPPING server from pid file /usr/local/mysql/var/localhost.localdomain.pid
080707 05:37:38 mysqld ended
[2]- Done /usr/local/mysql/bin/mysqld_safe
[root@localhost mysql]#
[root@localhost mysql]# chmod -R 777 var/
[root@localhost mysql]# /usr/local/mysql/bin/mysqld_safe &
[2] 23111
[root@localhost mysql]# chown: ‘mysql’: 无效的用户
Starting mysqld daemon with databases from /usr/local/mysql/var
STOPPING server from pid file /usr/local/mysql/var/localhost.localdomain.pid
080707 05:39:17 mysqld ended
[2]- Done /usr/local/mysql/bin/mysqld_safe
[root@localhost mysql]# groupadd mysql
[root@localhost mysql]# useradd mysql
useradd: group mysql exists - if you want to add this user to that group, use -g.
[root@localhost mysql]# useradd mysql -g mysql
[root@localhost mysql]# bin/mysql_install_db --user=mysql
Installing MySQL system tables...
OK
Filling help tables...
OK
To start mysqld at boot time you have to copy
support-files/mysql.server to the right place for your system
PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:
/usr/local/mysql/bin/mysqladmin -u root password "new-password"
/usr/local/mysql/bin/mysqladmin -u root -h localhost.localdomain password "new-password"
See the manual for more instructions.
You can start the MySQL daemon with:
cd /usr/local/mysql ; /usr/local/mysql/bin/mysqld_safe &
You can test the MySQL daemon with mysql-test-run.pl
cd mysql-test ; perl mysql-test-run.pl
Please report any problems with the /usr/local/mysql/bin/mysqlbug script!
The latest information about MySQL is available on the web at
http://www.mysql.com
Support MySQL by buying support/licenses at http://shop.mysql.com
[root@localhost mysql]# ls
bin include info lib libexec man mysql-test share sql-bench var
[root@localhost mysql]# chown -R root
chown: 参数太少
请尝试执行‘chown --help’来获取更多信息。
[root@localhost mysql]# chown -R root .
[root@localhost mysql]# chown -R mysql var
[root@localhost mysql]# chown -R mysql var/.
[root@localhost mysql]# chown -R mysql var/mysql/.
[root@localhost mysql]# chown -R mysql .
[root@localhost mysql]# bin/mysqld_safe --user=mysql &
[2] 30060
[root@localhost mysql]# Starting mysqld daemon with databases from /usr/local/mysql/var
[root@localhost mysql]# ls
bin include info lib libexec man mysql-test share sql-bench var
[root@localhost mysql]# cp share/mysql/mysql
mysql_fix_privilege_tables.sql mysql_system_tables_data.sql
mysql-log-rotate mysql_system_tables.sql
mysql.server mysql_test_data_timezone.sql
[root@localhost mysql]# cp share/mysql/mysql
mysql_fix_privilege_tables.sql mysql_system_tables_data.sql
mysql-log-rotate mysql_system_tables.sql
mysql.server mysql_test_data_timezone.sql
[root@localhost mysql]# cp share/mysql/mysql.server /etc/rc.d/init.d/mysql
[root@localhost mysql]# /etc/rc
rc rc1.d rc3.d rc5.d rc.d rc.sysinit
rc0.d rc2.d rc4.d rc6.d rc.local
[root@localhost mysql]# /etc/rc.d/init.d/mysql stop
Shutting down MySQL.STOPPING server from pid file /usr/local/mysql/var/localhost.localdomain.pid
SUCCESS!
[root@localhost mysql]# 080707 05:51:50 mysqld ended
[2]- Done bin/mysqld_safe --user=mysql
[root@localhost mysql]# /etc/rc.d/init.d/mysql start
Starting MySQL. SUCCESS!
[root@localhost mysql]# mysql
-bash: mysql: command not found
[root@localhost mysql]# cd ..
[root@localhost local]# cd mysql/
[root@localhost mysql]# bin/my
myisamchk mysql_find_rows
myisam_ftdump mysql_fix_extensions
myisamlog mysql_fix_privilege_tables
myisampack mysqlhotcopy
my_print_defaults mysqlimport
mysql mysql_install_db
mysqlaccess mysql_secure_installation
mysqladmin mysql_setpermission
mysqlbinlog mysqlshow
mysqlbug mysql_tableinfo
mysqlcheck mysqltest
mysql_client_test mysqltestmanagerc
mysql_config mysqltestmanager-pwgen
mysql_convert_table_format mysql_tzinfo_to_sql
mysqld_multi mysql_upgrade
mysqld_safe mysql_upgrade_shell
mysqldump mysql_waitpid
mysqldumpslow mysql_zap
mysql_explain_log
[root@localhost mysql]# bin/my
-bash: bin/my: 没有那个文件或目录
[root@localhost mysql]# bin/mysql
Welcome to the MySQL monitor. Commands end with ; or g.
Your MySQL connection id is 1
Server version: 5.0.40-log Source distribution
Type "help;" or "h" for help. Type "c" to clear the buffer.
mysql> mysqladmin -uroot password 123
-> ;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near "mysqladmin -uroot password 123" at line 1
mysql> mysqladmin -uroot password
-> ;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near "mysqladmin -uroot password" at line 1
mysql> quit
Bye
[root@localhost mysql]# bin/mysqladmin -uroot password
bin/mysqladmin: Too few arguments to change password
[root@localhost mysql]# bin/mysqladmin -uroot password 123
[root@localhost mysql]# bin/mysql -uroot -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or g.
Your MySQL connection id is 4
Server version: 5.0.40-log Source distribution
Type "help;" or "h" for help. Type "c" to clear the buffer.
mysql> quit
Bye

蛋疼不解释。

网友评论
评论
发 布

更多软件教程
  • 软件教程推荐
更多+
Greenfoot设置中文的方法

Greenfoot设置中文的方法

Greenfoot是一款简单易用的Java开发环境,该软件界面清爽简约,既可以作为一个开发框使用,也能够作为集成开发环境使用,操作起来十分简单。这款软件支持多种语言,但是默认的语言是英文,因此将该软件下载到电脑上的时候,会发现软件的界面语言是英文版本的,这对于英语基础较差的朋友来说,使用这款软件就会...

07-05

Egret UI Editor修改快捷键的方法

Egret UI Editor修改快捷键的方法

Egret UI Editor是一款开源的2D游戏开发代码编辑软件,其主要功能是针对Egret项目中的Exml皮肤文件进行可视化编辑,功能十分强大。我们在使用这款软件的过程中,可以将一些常用操作设置快捷键,这样就可以简化编程,从而提高代码编辑的工作效率。但是这款软件在日常生活中使用得不多,并且专业性...

07-05

KittenCode新建项目的方法

KittenCode新建项目的方法

KittenCode是一款十分专业的编程软件,该软件给用户提供了可视化的操作界面,支持Python语言的编程开发以及第三方库管理,并且提供了很多实用的工具,功能十分强大。我们在使用这款软件进行编程开发的过程中,最基本、最常做的操作就是新建项目,因此我们很有必要掌握新建项目的方法。但是这款软件的专业性...

07-05

Thonny设置中文的方法

Thonny设置中文的方法

Thonny是一款十分专业的Python编辑软件,该软件界面清爽简单,给用户提供了丰富的编程工具,具备代码补全、语法错误显示等功能,非常的适合新手使用。该软件还支持多种语言,所以在下载这款软件的时候,有时候下载到电脑中的软件是英文版本的,这对于英语基础较差的小伙伴来说,使用这款软件就会变得十分困难,...

07-05

最新软件下载