首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 数据库 > Mysql >

mysql安装时遇到的有关问题解决

2012-10-06 
mysql安装时遇到的问题解决1,安装完成后,在etc/下面增加了 my.cnf文件,再次启动mysql时报错, MySQL: mysql

mysql安装时遇到的问题解决

1,安装完成后,在etc/下面增加了 my.cnf文件,再次启动mysql时报错, MySQL: mysql is not running but lock exists,经检查是my.cnf文件中[root@localhost etc]# cat my.cnf # The following options will be passed to all MySQL clients[client]#password = your_passwordport = 3306socket = /var/lib/mysql/mysql.sockdefault-character-set = utf8# The MySQL server[mysqld]port = 3306socket = /var/lib/mysql/mysql.sockskip-lockingkey_buffer_size = 16Kmax_allowed_packet = 1Mtable_open_cache = 4sort_buffer_size = 64Kread_buffer_size = 256Kread_rnd_buffer_size = 256Knet_buffer_length = 2Kthread_stack = 128Kdefault-storage-engine=INNODBinnodb_data_home_dir = /home/data/ibdatainnodb_data_file_path = ibdata1:10M:autoextendinnodb_log_group_home_dir = /home/data/ibdatadefault-character-set = utf8lower_case_table_names=1# Don't listen on a TCP/IP port at all. This can be a security enhancement,# if all processes that need to connect to mysqld run on the same host.# All interaction with mysqld must be made via Unix sockets or named pipes.# Note that using this option without enabling named pipes on Windows# (using the "enable-named-pipe" option) will render mysqld useless!# #skip-networkingserver-id = 1# Uncomment the following if you want to log updates#log-bin=mysql-bin# binary logging format - mixed recommended#binlog_format=mixed# Uncomment the following if you are using InnoDB tables#innodb_data_home_dir = /var/lib/mysql/#innodb_data_file_path = ibdata1:10M:autoextend#innodb_log_group_home_dir = /var/lib/mysql/# You can set .._buffer_pool_size up to 50 - 80 %# of RAM but beware of setting memory usage too high#innodb_buffer_pool_size = 16M#innodb_additional_mem_pool_size = 2M# Set .._log_file_size to 25 % of buffer pool size#innodb_log_file_size = 5M#innodb_log_buffer_size = 8M#innodb_flush_log_at_trx_commit = 1#innodb_lock_wait_timeout = 50[mysqldump]quickmax_allowed_packet = 16M[mysql]no-auto-rehash# Remove the next comment character if you are not familiar with SQL#safe-updates[myisamchk]key_buffer_size = 8Msort_buffer_size = 8M[mysqlhotcopy]interactive-timeout上述中,指定的存储数据文件夹没有创建

问题2:启动系统登录时,报sql错误原因:

linux下mysql安装完后是默认:区分表名的大小写,不区分列名的大小写;

用root帐号登录后,在/etc/my.cnf 中的[mysqld]后添加添加lower_case_table_names=1,

重启MYSQL服务,这时已设置成功:不区分表名的大小写;lower_case_table_names参数详解:lower_case_table_names = 0其中 0:区分大小写,1:不区分大小写

?

MySQL在Linux下数据库名、表名、列名、别名大小写规则是这样的:

1、数据库名与表名是严格区分大小写的;

2、表的别名是严格区分大小写的;

3、列名与列的别名在所有的情况下均是忽略大小写的;

4、变量名也是严格区分大小写的;

?

MySQL在Windows下都不区分大小写。

3、如果想在查询时区分字段值的大小写,则:字段值需要设置BINARY属性,设置的方法有多种:

A、创建时设置:CREATE TABLE T(A VARCHAR(10) BINARY);

B、使用alter修改:ALTER TABLE `tablename` MODIFY COLUMN `cloname` VARCHAR(45) BINARY;

C、mysql table editor中直接勾选BINARY项。按照上述修改后,成功登录

热点排行