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-configuredrwxr-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.inidrwxr-xr-x 2 root root 4096 12-29 23:06 czechdrwxr-xr-x 2 root root 4096 12-29 23:06 danishdrwxr-xr-x 2 root root 4096 12-29 23:06 dutchdrwxr-xr-x 2 root root 4096 12-29 23:06 english-rwxr-xr-x 1 root root 469420 11-23 20:46 errmsg-utf8.txtdrwxr-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.sqldrwxr-xr-x 2 root root 4096 12-29 23:06 frenchdrwxr-xr-x 2 root root 4096 12-29 23:06 germandrwxr-xr-x 2 root root 4096 12-29 23:06 greekdrwxr-xr-x 2 root root 4096 12-29 23:06 hungariandrwxr-xr-x 2 root root 4096 12-29 23:06 italiandrwxr-xr-x 2 root root 4096 12-29 23:06 japanesedrwxr-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.inidrwxr-xr-x 2 root root 4096 12-29 23:06 norwegiandrwxr-xr-x 2 root root 4096 12-29 23:06 norwegian-nydrwxr-xr-x 2 root root 4096 12-29 23:06 polishdrwxr-xr-x 2 root root 4096 12-29 23:06 portuguesedrwxr-xr-x 2 root root 4096 12-29 23:06 romaniandrwxr-xr-x 2 root root 4096 12-29 23:06 russiandrwxr-xr-x 3 root root 4096 12-29 23:06 SELinuxdrwxr-xr-x 2 root root 4096 12-29 23:06 serbiandrwxr-xr-x 2 root root 4096 12-29 23:06 slovakdrwxr-xr-x 2 root root 4096 12-29 23:06 spanishdrwxr-xr-x 2 root root 4096 12-29 23:06 swedishdrwxr-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_logfile1drwx--x--x 2 mysql mysql 4096 12-24 15:46 mysqldrwx------ 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-LASTdrwxr-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进程的详细命令里指向的是哪个配置文件。
详细内容,请看我的文章:
http://iihero.iteye.com/blog/995046
[解决办法]
这个没有的话可以自己配的,我的就是自己配的。
如果/etc/目录下没有my.cnf 配置文件,可以到/usr/share/mysql/下找到*.cnf 文件,拷贝其中一个到/etc/并改名为my.cnf)。
然后你根据自己的需要修改部分参数就可以了。