安装的时候Fedora11把自带的MySql数据装上。
1、先查看 /etc/rc.d/init.d/mysqld status 看看m y s q l 是否已经启动.
另外看看是不是权限问题.
2、确定你的mysql.sock是不是在那个位置,
mysql -u 你的mysql用户名 -p -S /var/lib/mysql/mysql.sock
3、试试:service mysqld start
[root@localhost ~]# service mysqld start
\\开启MySQL数据库服务
Starting MySQL: [ OK ]
[root@localhost ~]# /etc/rc.d/init.d/mysqld status
\\查看状态
mysqld (pid 3368) is running...
mysql> ?
\\查看帮助信息
For information about MySQL products and services, visit:
http://www.mysql.com/
For developer information, including the MySQL Reference Manual, visit:
http://dev.mysql.com/
To buy MySQL Network Support, training, or other products, visit:
https://shop.mysql.com/
List of all MySQL commands:
Note that all text commands must be first on line and end with ';'
? (\?) Synonym for `help'.
clear (\c) Clear command.
connect (\r) Reconnect to the server. Optional arguments are db and host.
delimiter (\d) Set statement delimiter. NOTE: Takes the rest of the line as new delimiter.
edit (\e) Edit command with $EDITOR.
ego (\G) Send command to mysql server, display result vertically.
exit (\q) Exit mysql. Same as quit.
go (\g) Send command to mysql server.
help (\h) Display this help.
nopager (\n) Disable pager, print to stdout.
notee (\t) Don't write into outfile.
pager (\P) Set PAGER [to_pager]. Print the query results via PAGER.
print (\p) Print current command.
prompt (\R) Change your mysql prompt.
quit (\q) Quit mysql.
rehash (\#) Rebuild completion hash.
source (\.) Execute an SQL script file. Takes a file name as an argument.
status (\s) Get status information from the server.
system (\!) Execute a system shell command.
tee (\T) Set outfile [to_outfile]. Append everything into given outfile.
use (\u) Use another database. Takes database name as argument.
charset (\C) Switch to another charset. Might be needed for processing binlog with multi-byte charsets.
warnings (\W) Show warnings after every statement.
nowarning (\w) Don't show warnings after every statement.
For server side help, type 'help contents'
mysql> \q
Writing history-file /root/.mysql_history
Bye
[root@localhost ~]# yum install mysql-query-browser
\\ 在线安装mysql-query-browser
Loaded plugins: refresh-packagekit
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package mysql-query-browser.i586 0:5.0r12-11.fc11 set to be updated
--> Processing Dependency: mysql-gui-common = 5.0r12-11.fc11 for package: mysql-query-browser-5.0r12-11.fc11.i586
--> Running transaction check
---> Package mysql-gui-common.i586 0:5.0r12-11.fc11 set to be updated
--> Finished Dependency Resolution
Dependencies Resolved
================================================================================
Package Arch Version Repository Size
================================================================================
Installing:
mysql-query-browser i586 5.0r12-11.fc11 fedora 1.5 M
Installing for dependencies:
mysql-gui-common i586 5.0r12-11.fc11 fedora 221 k
Transaction Summary
================================================================================
Install 2 Package(s)
Upgrade 0 Package(s)
Total download size: 1.7 M
Is this ok [y/N]: y
Downloading Packages:
http://ftp.kddilabs.jp/Linux/packages/fedora/archive/fedora/linux/releases/11/Everything/i386/os/Packages/mysql-gui-common-5.0r12-11.fc11.i586.rpm: [Errno 14] HTTP Error 404: Not Found
Trying other mirror.
(1/2): mysql-gui-common-5.0r12-11.fc11.i586.rpm | 221 kB 00:00
(2/2): mysql-query-browser-5.0r12-11.fc11.i586.rpm | 1.5 MB 00:04
--------------------------------------------------------------------------------
Total 276 kB/s | 1.7 MB 00:06
Running rpm_check_debug
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
Installing : mysql-gui-common-5.0r12-11.fc11.i586 1/2
Installing : mysql-query-browser-5.0r12-11.fc11.i586 2/2
Installed:
mysql-query-browser.i586 0:5.0r12-11.fc11
Dependency Installed:
mysql-gui-common.i586 0:5.0r12-11.fc11
Complete!
[root@localhost ~]#
[root@localhost ~]# yum install mysql-administrator \\ 在线安装mysql-administrator
Loaded plugins: refresh-packagekit
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package mysql-administrator.i586 0:5.0r12-11.fc11 set to be updated
--> Finished Dependency Resolution
Dependencies Resolved
===============================================================================
Package Arch Version Repository Size
===============================================================================
Installing:
mysql-administrator i586 5.0r12-11.fc11 fedora 1.7 M
Transaction Summary
===============================================================================
Install 1 Package(s)
Upgrade 0 Package(s)
Total download size: 1.7 M
Is this ok [y/N]: y
Downloading Packages:
http://ftp.kddilabs.jp/Linux/packages/fedora/archive/fedora/linux/releases/11/Everything/i386/os/Packages/mysql-administrator-5.0r12-11.fc11.i586.rpm: [Errno 14] HTTP Error 404: Not Found
Trying other mirror.
mysql-administrator-5.0r12-11.fc11.i586.rpm | 1.7 MB 00:04
Running rpm_check_debug
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
Installing : mysql-administrator-5.0r12-11.fc11.i586 1/1
Installed:
mysql-administrator.i586 0:5.0r12-11.fc11
Complete!
[root@localhost ~]#
[root@localhost ~]# mysql
mysql> show databases;
\\查看数据库
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| test |
+--------------------+
3 rows in set (0.00 sec)
mysql> use mysql;
\\使用mysql数据库
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Database changed
mysql> show tables;
\\查看mysql数据库的的表
+---------------------------+
| Tables_in_mysql |
+---------------------------+
| columns_priv |
| db |
| event |
| func |
| general_log |
| help_category |
| help_keyword |
| help_relation |
| help_topic |
| host |
| ndb_binlog_index |
| plugin |
| proc |
| procs_priv |
| servers |
| slow_log |
| tables_priv |
| time_zone |
| time_zone_leap_second |
| time_zone_name |
| time_zone_transition |
| time_zone_transition_type |
| user |
+---------------------------+
23 rows in set (0.00 sec)
mysql> \q
\\退出
Bye
[root@localhost ~]#
配置图形化操作工具
Applications(应用程序)——》Programming(编程)——》MySQL Administrator,
打开图形界面MySQL Administrator
MySQL Administrator设置:
Server Hostname 写 localhost (或者 127.0.0.1)
Username 默认为 root (或者其他设置的用户)
Password 不用填 (不行的话填你安装MySQL时候对应的用户密码)
其他项暂时可以不填
MySQL Query Browser设置:
Server Hostname 写 localhost (或者 127.0.0.1)
Username 默认为 root (或者其他设置的用户)
Password 不用填 (或填你安装MySQL时候对应的用户密码 )
其他项暂时可以不填
到目前为止我的MySQL Administrator和MySQL Query Browser已经全部安装成功,以后就是用这两个工具对MySQL进行管理操作了。