|
我下载了一个mysql-5.1.7-beta-linux-i686放在/usr/local/src/,并解压了!!
cd ../ 回到/usr/local/里
ln -s /usr/local/src/mysql-5.1.7-beta-linux-i686 mysql创那超XX
设置mysql-5.1.7-beta-linux-i686里文件的访问权限
cd ./mysql
./scripts/mysql_install_db
结果出现:[code:1]Installing all prepared tables
Fill help tables
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:
./bin/mysqladmin -u root password 'new-password'
./bin/mysqladmin -u root -h localhost.localdomain password 'new-password'
See the manual for more instructions.
NOTE: If you are upgrading from a MySQL <= 3.22.10 you should run
the ./bin/mysql_fix_privilege_tables. Otherwise you will not be
able to use the new GRANT command!
You can start the MySQL daemon with:
cd . ; ./bin/mysqld_safe &
You can test the MySQL daemon with the benchmarks in the 'sql-bench' directory:
cd sql-bench ; perl run-all-tests
Please report any problems with the ./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 https://order.mysql.com
[/code:1]
这个大致是说已经初始化了mysql表吧!!!是安装完mysql后,它给你的提示,告诉你如何启动,如何修改密码等信息。
上面的错不管它!
[code:1]有些朋友是习惯用 ./bin/mysqld_safe & 这个启动mysql面不用./scripts/mysql_install_db。
另外,它启动失败,你就去 mysql/data 下看错误日志,就是 err 后缀名的那个,看它里面写什么原因。
还有一下就是:./scripts/mysql_install_db --user=mane <-- 如果你当前登录账号和后面这个参数中指定的一样的,也可以不加那个参数,关键是用一个可以对 mysql 目录有 写 权限的账号
机器上有 /etc/my.cnf,那代表已经安装了 MySQL
[/code:1]
我启动服务后,运行mysql -uroot -p然后回车,提示我输入密码,因为初始密码为空,我就直接回车了,然后
出现了mysql>
我输入show databases;回车
显示出四个数据库表
information_schema
mysql
test
wyp
后来我输入use mysql;回车
选择了一个数据库,
然后输入update user set password="mysql" where user='root';回车(这句应该是给root设置密码的吧)
提示我修改成功,后来输入exit退出mysql;
之后再输入mysql -uroot -p回车
输入新设置的密码mysql
出错:ERROR 1045 (28000): Access denied for user 'root'@'localhost'
然后用空密码进 却可以进入数据库,但是只显示两个数据库表:
information_schema
test
另外两个不见了,也运行不了create database, 只能用显示出来的两个数据库,这是为什么,
还麻烦您给出个主意,或者说怎么能把密码删掉,恢复到原来密码为空状态.
谢谢!!!! |
|