Linux does not have the My.cnf file solution, is completely my own whole, a lot of tutorials are nonsense (Zhuan)

Source: Internet
Author: User
Tags change settings dedicated server mysql login

Http://blog.csdn.net/jspping/article/details/40400691?utm_source=tuicool&utm_medium=referral

******************************************************************************

I read a lot about Linux without my.cnf blog, what is RMP install no my.cnf file Ah, and then what two methods Ah, I have no words, if you know will not check the information, you dare not take charge of the point? Tell me the details. Some say it is useful to copy a. cnf file from/usr/share/mysql to/etc? Profile data not to others, copy a yarn? Copy who will!


MY.CNF configuration file:


[Java]View PlainCopy
  1. # for advice The change settings
  2. # http://dev.mysql.com/doc/refman/5.6/en/server-configuration-defaults.html
  3. # * * * Don't EDIT this FILE. It ' s a template which'll be copied to the
  4. # * * * default location during install, and would be replaced if you
  5. # * * * * Upgrade to a newer version of MySQL.
  6. [Mysqld]
  7. #innodb
  8. # Remove Leading
  9. # and set to the amount of RAM for the most important data
  10. # Cache in MySQL.  Start at 70% of all RAM for dedicated server, else 10%.
  11. Innodb_buffer_pool_size = 4000M
  12. innodb_additional_mem_pool_size=60m
  13. Innodb_data_home_dir=
  14. Innodb_date_file_path=ibdata1:20m:autoextend
  15. Innodb_log_group_home_dir=/var/log/innodb_log
  16. innodb_log_files_in_group=2
  17. innodb_log_file_size=30m
  18. innodb_log_buffer_size=3m
  19. Innodb_doublewrite=on
  20. innodb_open_file=
  21. Innodb_file_per_table=on
  22. innodb_max_dirty_page_pct=
  23. back_log=
  24. interactive_timeout=3600
  25. key_buffer_size=10m
  26. max_allow_packet=40440
  27. max_connections=
  28. max_tmp_tables=
  29. query_cache_size=10m
  30. sor_buffer_size=10m
  31. Table_open_cache=
  32. # Remove Leading
  33. # to turn on a very important data integrity option:logging
  34. # Changes to the binary log between backups.
  35. #lob_bin
  36. Log_bin=on
  37. Log_bin_basename=/var/lib/mysql/mysqld-bin
  38. #
  39. # Remove Leading # To set options mainly useful for reporting servers.
  40. # The server defaults is faster for transactions and fast selects.
  41. # Adjust sizes as needed, experiment to find the optimal values.
  42. Join_buffer_size = 128M
  43. Sort_buffer_size = 2M
  44. Read_rnd_buffer_size = 2M
  45. Datadir=/var/lib/mysql
  46. Socket=/var/lib/mysql/mysql.sock
  47. Character_set_server=utf8
  48. #init_connect =' SET NAMES UTF8 '
  49. # Disabling Symbolic-links is recommended to prevent assorted security risks
  50. symbolic-links=0
  51. # Recommended in standard MySQL setup
  52. Sql_mode=no_engine_substitution,strict_trans_tables
  53. #general_log
  54. General_log=on
  55. General_log_file=/var/lib/mysql/localhost.log
  56. #slow_query_log
  57. Slow_query_log=on
  58. Slow_query_log_file=/var/lib/mysql/localhost-slow.log
  59. Slow_launch_time=2
  60. [Mysqld_safe]
  61. Log-error=/var/log/mysqld.log
  62. Pid-file=/var/run/mysqld/mysqld.pid


If the above file is configured, perform MySQL login, throw xxxx.line Such an exception, go to /usr/share/mysql below to copy a. cnf file header to replace the above MY.CNF header code, if you want to copy a to/ etc, named My.cnf, then put the above copy, version information and some details of the file

Specific path configuration, and parameter configuration see your own installation situation


I replaced these sentences with the/USR/SHARE/MYSQL/MY-DEFAULT.CNF header file:

[Plain]View PlainCopy
    1. # for advice The change settings
    2. # http://dev.mysql.com/doc/refman/5.6/en/server-configuration-defaults.html
    3. # * * * Don't EDIT this FILE. It ' s a template which'll be copied to the
    4. # * * * default location during install, and would be replaced if you
    5. # * * * * Upgrade to a newer version of MySQL.
    6. [Mysqld]


Then [MYSQLLD] below all is copy above, starting with the # number on line 7th of the configuration file above, can resolve similar Fatal Error in defaults handling. Program aborted or XXXX line xxxx error problem, according to the specific situation of your server specific analysis, my is based on my configured as the benchmark


Once configured, MySQL can log in normally to view and start the log:

[Plain]View PlainCopy
  1. Mysql> Show variables like ' log_% ';
  2. +----------------------------------------+------------------------------------+
  3. | variable_name | Value |
  4. +----------------------------------------+------------------------------------+
  5. | Log_bin | OFF |
  6. |                                    Log_bin_basename | |
  7. |                                    Log_bin_index | |
  8. | log_bin_trust_function_creators | OFF |
  9. | log_bin_use_v1_row_events | OFF |
  10. | Log_error | /var/lib/mysql/ay140615022008z.err |
  11. | Log_output | FILE |
  12. | log_queries_not_using_indexes | OFF |
  13. | Log_slave_updates | OFF |
  14. | log_throttle_queries_not_using_indexes | 0 |
  15. | log_warnings | 1 |
  16. +----------------------------------------+------------------------------------+
  17. Rows in Set (0.01 sec)
  18. Mysql> Show variables like ' Log_bin ';
  19. +---------------+-------+
  20. | variable_name | Value |
  21. +---------------+-------+
  22. | Log_bin | OFF |
  23. +---------------+-------+
  24. 1 row in Set (0.00 sec)


[Plain]View PlainCopy
    1. Mysql> select version ();
    2. +-----------+
    3. | Version () |
    4. +-----------+
    5. | 5.6.10 |
    6. +-----------+
    7. 1 row in Set (0.02 sec)



Need to open can set their own, hope can help everyone, less go fruitless!

Linux does not have the My.cnf file solution, is completely my own whole, a lot of tutorials are nonsense (Zhuan)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.