安装目录:/usr/local/tomcat/apache-tomcat-6.0.44/bin(在阿里云服务器中)。
转载网址:http://www.cnblogs.com/kerrycode/p/3588816.html
1.下载linux mysql。地址:http://dev.mysql.com/get/Downloads/MySQL-5.1/mysql-5.1.30-linux-x86_64-glibc23.tar.gz/from/http://mysql.he.net/
2.通过putty上传:pscp mysql.tar.gz root@120.26.207.185:/home
3.在linux中的home目录中,找到mysql.tar.gz
4.安装:rpm -ivh MySQL-server-5.1.68-1.glibc23.x86_64.rpm
Preparing... ########################################### [100%]
1:MySQL-server ########################################### [100%]
PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:
/usr/bin/mysqladmin -u root password 'new-password'
/usr/bin/mysqladmin -u root -h localhost.localdomain password 'new-password'
Alternatively you can run:
/usr/bin/mysql_secure_installation
which will also give you the option of removing the test
databases and anonymous user created by default. This is
strongly recommended for production servers.
See the manual for more instructions.
Please report any problems with the /usr/bin/mysqlbug script!
Starting MySQL. SUCCESS!
[root@localhost soft]# mysql
-bash: /bin/mysql: 没有那个文件或目录
5.登陆:
登录MySQL
命令是mysql, mysql 的使用语法如下:
mysql [-u username] [-h host] [-p[password]] [dbname]
username 与 password 分别是 MySQL 的用户名与密码,mysql的初始管理帐号是root,没有密码,注意:这个root用户不是Linux的系统用户。MySQL默认用户是root,由于初始没有密码,第一次进时只需键入mysql即可。
MySQL默认没有密码,安装完毕增加密码的重要性是不言而喻的。
1、命令
usr/bin/mysqladmin -u root password 'new-password'
格式:mysqladmin -u用户名 -p旧密码 password 新密码
2、例子
例1:给root加个密码123456。
键入以下命令 :
[root@test1 local]# /usr/bin/mysqladmin -u root password 123456
注:因为开始时root没有密码,所以-p旧密码一项就可以省略了。
3、测试是否修改成功
1)不用密码登录
[root@test1 local]# mysql
ERROR 1045: Access denied for user: 'root@localhost' (Using password: NO)
显示错误,说明密码已经修改。
2)用修改后的密码登录
[root@test1 local]# mysql -u root -p