Advertisement
shivakrshn49

MerianDB README.txt

Dec 23rd, 2016
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.51 KB | None | 0 0
  1. * MYSQL WON'T START OR STOP?:
  2. =============================
  3. You may never ever delete the mysql user "root". Although it has no password
  4. is set, the unix_auth plugin ensure that it can only be run locally as the root
  5. user. The credentials in /etc/mysql/debian.cnf specify the user are used by the
  6. init scripts to stop the server and perform logrotation. So in most of the
  7. time you can fix the situation by making sure that the /etc/mysql/debian.cnf
  8. file specifies the root user and no password.
  9.  
  10. This used to be the debian-sys-maint user which is no longer used.
  11.  
  12. * WHAT TO DO AFTER UPGRADES:
  13. ============================
  14. The privilege tables are automatically updated so all there is left is read
  15. the release notes on https://mariadb.com/kb/en/release-notes/ to see if any
  16. changes affect custom apps.
  17.  
  18. * WHAT TO DO AFTER INSTALLATION:
  19. ================================
  20. The MySQL manual describes certain steps to do at this stage in a separate
  21. chapter. They are not necessary as the Debian packages does them
  22. automatically.
  23.  
  24. The only thing that is left over for the admin is
  25. - setting the passwords
  26. - creating new users and databases
  27. - read the rest of this text
  28.  
  29. * NETWORKING:
  30. =============
  31. For security reasons, the Debian package has enabled networking only on the
  32. loop-back device using "bind-address" in /etc/mysql/my.cnf. Check with
  33. "netstat -tlnp" where it is listening. If your connection is aborted
  34. immediately check your firewall rules or network routes.
  35.  
  36. * WHERE IS THE DOCUMENTATION?:
  37. ==============================
  38. https://mariadb.com/kb
  39.  
  40. * PASSWORDS:
  41. ============
  42. It is strongly recommended you create an admin users for your database
  43. adminstration needs.
  44.  
  45. If your your local unix account is the one you want to have local super user
  46. access on your database with you can create the following account that will
  47. only work for the local unix user connecting to the database locally.
  48.  
  49. sudo /usr/bin/mysql -e "GRANT ALL ON *.* TO '$USER'@'localhost' IDENTIFIED VIA unix_socket WITH GRANT OPTION"
  50.  
  51. To create a local machine account username=USERNAME with a password:
  52.  
  53. sudo /usr/bin/mysql -e "GRANT ALL ON *.* TO 'USERNAME'@'localhost' IDENTIFIED BY 'password' WITH GRANT OPTION"
  54.  
  55. To create a USERNAME user with password 'password' admin user that can access
  56. the DB server over the network:
  57.  
  58. sudo /usr/bin/mysql -e "GRANT ALL ON *.* TO 'USERNAME'@'%' IDENTIFIED BY 'password' WITH GRANT OPTION"
  59.  
  60. Scripts should run as a user have have the required grants and be identified via unix_socket.
  61.  
  62. If you are too tired to type the password in every time and unix_socket auth
  63. doesn't suit your needs, you can store it in the file $HOME/.my.cnf. It should
  64. be chmod 0600 (-rw------- username username .my.cnf) to ensure that nobody else
  65. can read it. Every other configuration parameter can be stored there, too.
  66.  
  67. For more information in the MariaDB manual in/usr/share/doc/mariadb-doc or
  68. https://mariadb.com/kb/en/configuring-mariadb-with-mycnf/.
  69.  
  70. ATTENTION: It is necessary, that a ~/.my.cnf from root always contains a "user"
  71. line wherever there is a "password" line, else, the Debian maintenance
  72. scripts, that use /etc/mysql/debian.cnf, will use the username
  73. "root" but the password that is in root's .my.cnf. Also note,
  74. that every change you make in the /root/.my.cnf will affect the mysql cron
  75. script, too.
  76.  
  77. # an example of $HOME/.my.cnf
  78. [client]
  79. user = your-mysql-username
  80. password = enter-your-good-new-password-here
  81. * FURTHER NOTES ON REPLICATION
  82. ===============================
  83. If the MySQL server is acting as a replication slave, you should not
  84. set --tmpdir to point to a directory on a memory-based filesystem or to
  85. a directory that is cleared when the server host restarts. A replication
  86. slave needs some of its temporary files to survive a machine restart so
  87. that it can replicate temporary tables or LOAD DATA INFILE operations. If
  88. files in the temporary file directory are lost when the server restarts,
  89. replication fails.
  90.  
  91. * DOWNGRADING
  92. ============================
  93. Unsupported. Period.
  94.  
  95. You might get lucky downgrading a few minor versions without issued. Take a
  96. backup first. If you break it you get to keep both pieces. Do a restore from
  97. backup or upgrade to the previous version.
  98.  
  99. If doing a major version downgrade, take a mysqldump/mydumpber consistent
  100. backup using the current version and reload after downgrading and purging
  101. existing databases.
  102.  
  103. * BACKUPS
  104. ============================
  105. Backups save jobs. Don't get caught without one.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement