日期:2014-05-16  浏览次数:20896 次

linux安装最新mysql5.5,my.cnf找不到
mysql的安装路径应该是/usr/share/mysql:
SQL code

[root@CentOS202 Desktop]# ls /usr/share/mysql/ -l
总计 1320
-rwxr-xr-x 1 root root   1153 11-23 23:12 binary-configure
drwxr-xr-x 2 root root   4096 12-29 23:06 charsets
-rwxr-xr-x 1 root root   4528 11-23 23:12 config.huge.ini
-rwxr-xr-x 1 root root   2382 11-23 23:12 config.medium.ini
-rwxr-xr-x 1 root root   1626 11-23 23:12 config.small.ini
drwxr-xr-x 2 root root   4096 12-29 23:06 czech
drwxr-xr-x 2 root root   4096 12-29 23:06 danish
drwxr-xr-x 2 root root   4096 12-29 23:06 dutch
drwxr-xr-x 2 root root   4096 12-29 23:06 english
-rwxr-xr-x 1 root root 469420 11-23 20:46 errmsg-utf8.txt
drwxr-xr-x 2 root root   4096 12-29 23:06 estonian
-rwxr-xr-x 1 root root 619777 11-23 20:46 fill_help_tables.sql
drwxr-xr-x 2 root root   4096 12-29 23:06 french
drwxr-xr-x 2 root root   4096 12-29 23:06 german
drwxr-xr-x 2 root root   4096 12-29 23:06 greek
drwxr-xr-x 2 root root   4096 12-29 23:06 hungarian
drwxr-xr-x 2 root root   4096 12-29 23:06 italian
drwxr-xr-x 2 root root   4096 12-29 23:06 japanese
drwxr-xr-x 2 root root   4096 12-29 23:06 korean
-rwxr-xr-x 1 root root    773 11-23 20:46 magic
-rwxr-xr-x 1 root root   4697 11-23 23:12 my-huge.cnf
-rwxr-xr-x 1 root root  19779 11-23 23:12 my-innodb-heavy-4G.cnf
-rwxr-xr-x 1 root root   4671 11-23 23:12 my-large.cnf
-rwxr-xr-x 1 root root   4682 11-23 23:12 my-medium.cnf
-rwxr-xr-x 1 root root   2846 11-23 23:12 my-small.cnf
-rwxr-xr-x 1 root root   1061 11-23 23:12 mysqld_multi.server
-rwxr-xr-x 1 root root    789 11-23 23:12 mysql-log-rotate
-rwxr-xr-x 1 root root  10585 11-23 23:12 mysql.server
-rwxr-xr-x 1 root root   3258 11-23 20:46 mysql_system_tables_data.sql
-rwxr-xr-x 1 root root  28995 11-23 20:46 mysql_system_tables.sql
-rwxr-xr-x 1 root root  10371 11-23 20:46 mysql_test_data_timezone.sql
-rwxr-xr-x 1 root root   1326 11-23 23:12 ndb-config-2-node.ini
drwxr-xr-x 2 root root   4096 12-29 23:06 norwegian
drwxr-xr-x 2 root root   4096 12-29 23:06 norwegian-ny
drwxr-xr-x 2 root root   4096 12-29 23:06 polish
drwxr-xr-x 2 root root   4096 12-29 23:06 portuguese
drwxr-xr-x 2 root root   4096 12-29 23:06 romanian
drwxr-xr-x 2 root root   4096 12-29 23:06 russian
drwxr-xr-x 3 root root   4096 12-29 23:06 SELinux
drwxr-xr-x 2 root root   4096 12-29 23:06 serbian
drwxr-xr-x 2 root root   4096 12-29 23:06 slovak
drwxr-xr-x 2 root root   4096 12-29 23:06 spanish
drwxr-xr-x 2 root root   4096 12-29 23:06 swedish
drwxr-xr-x 2 root root   4096 12-29 23:06 ukrainian
[root@CentOS202 Desktop]# 


下面应该是数据存放路径:
SQL code
[root@CentOS202 Desktop]# ll /var/lib/mysql/
总计 28752
-rw-rw---- 1 mysql mysql     9939 12-29 23:12 CentOS202.err
-rw-rw---- 1 mysql mysql 18874368 12-29 23:12 ibdata1
-rw-rw---- 1 mysql mysql  5242880 12-29 23:12 ib_logfile0
-rw-rw---- 1 mysql mysql  5242880 12-24 15:48 ib_logfile1
drwx--x--x 2 mysql mysql     4096 12-24 15:46 mysql
drwx------ 2 mysql mysql     4096 12-24 15:46 performance_schema
-rw-r--r-- 1 mysql mysql      652 12-29 23:06 RPM_UPGRADE_HISTORY
-rw-r--r-- 1 mysql mysql      522 12-29 23:06 RPM_UPGRADE_MARKER-LAST
drwxr-xr-x 2 mysql mysql     4096 12-24 15:46 test
[root@CentOS202 Desktop]# 





我找了半天也没找到my.cnf文件在哪(windows是my.ini,linux是my.cnf)。请问各路高人,是否也遇到过这情况?我怎么才能自定义配置我的数据库啊???谢谢过了!!!

------解决方案--------------------
/etc/my.cnf
------解决方案--------------------
关于linux下my.ini配置文件的加载顺序,

(linux下,/etc/my.cnf->/etc/mysql/my.cnf->SYSCONFDIR/my.cnf->$MYSQL_HOME/my.cnf-> --defaults-extra-file->~/my.cnf

如果这几个位置都找不到呢?
ps -ef | grep mysql
看看mysql进程的详细命令里指向的是哪个配置文件