如看到有3306的端口号,就说明服务启动了,默认的端口是3306 ,如果没有启动的话 ,就打开服务 #service mysql start 启动mysql服务。
然后再输入mysql,若出现以下提示信息,说明成功。
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.5.16 MySQL Community Server (GPL)
Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
进入mysql数据库后:mysql>use mysql;
然后查看一下root的情况select user,password form user;
修改密码update user set password=password(‘newpassword’)where user=’root’ and host=’root’ or host=’localhost’;