11* MYSQL WON'T START OR STOP?:
22=============================
3- You may never ever delete the special mysql user "debian-sys-maint". This
4- user together with the credentials in /etc/mysql/debian.cnf are used by the
5- init scripts to stop the server as they would require knowledge of the mysql
6- root users password else.
7- So in most of the times you can fix the situation by making sure that the
8- debian.cnf file contains the right password, e.g. by setting a new one
9- (remember to do a "flush privileges" then).
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.
1011
1112* WHAT TO DO AFTER UPGRADES:
1213============================
1314The privilege tables are automatically updated so all there is left is read
14- the changelogs on dev.mysql.com to see if any changes affect custom apps.
15+ the release notes on https://mariadb.com/kb/en/release-notes/ to see if any
16+ changes affect custom apps.
1517
1618* WHAT TO DO AFTER INSTALLATION:
1719================================
1820The MySQL manual describes certain steps to do at this stage in a separate
1921chapter. They are not necessary as the Debian packages does them
2022automatically.
2123
22- The only thing that is left over for the admin is
24+ The only thing that is left over for the admin is
2325 - setting the passwords
2426 - creating new users and databases
2527 - read the rest of this text
2628
27- * DOWNGRADING TO 4.0 or 4.1:
28- ============================
29- Unsupported. Period.
30- But if you do and get problems or make interesting experiences, mail me, it
31- might help others.
32- Ok, if you really want, I would recommend to "mysqldump --opt" all tables,
33- then purge 4.1, delete /var/lib/mysql, install 4.0 and insert the dumps. Be
34- carefully, though, with the "mysql" table, you might not simply overwrite that
35- one as the password for the mysql "debian-sys-maint" user is stored in
36- /etc/mysql/debian.cnf and needed by /etc/init.d/ to start mysql and check if
37- it's alive.
38-
39- * SOME APPLICATION CAN NO LONGER CONNECT:
40- =========================================
41- This application is probably linked against libmysqlclient12 or below and
42- somebody has created a mysql user with new-style passwords.
43- The old_passwords=1 option in /etc/mysql/my.cnf might help. If not the
44- application that inserted the user has to be changed or the application that
45- tries to connect updated to libmysqlclient14 or -15.
46-
4729* NETWORKING:
4830=============
4931For security reasons, the Debian package has enabled networking only on the
5032loop-back device using "bind-address" in /etc/mysql/my.cnf. Check with
5133"netstat -tlnp" where it is listening. If your connection is aborted
52- immediately see if "mysqld: all" or similar is in /etc/hosts.allow and read
53- hosts_access(5).
34+ immediately check your firewall rules or network routes.
5435
5536* WHERE IS THE DOCUMENTATION?:
5637==============================
57- Unfortunately due to licensing restrictions, debian currently not able
58- to provide the mysql-doc package in any format. For the most up to date
59- documentation, please go to http://dev.mysql.com/doc.
38+ https://mariadb.com/kb
6039
6140* PASSWORDS:
6241============
63- It is strongly recommended to set a password for the mysql root user (which
64- /usr/bin/mysql -u root -D mysql -e "update user set password=password('new-password') where user='root'"
65- /usr/bin/mysql -u root -e "flush privileges"
66- If you already had a password set add "-p" before "-u" to the lines above.
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"
6759
60+ Scripts should run as a user have have the required grants and be identified via unix_socket.
6861
69- If you are tired to type the password in every time or want to automate your
70- scripts you can store it in the file $HOME/.my.cnf. It should be chmod 0600
71- (-rw------- username username .my.cnf) to ensure that nobody else can read
72- it. Every other configuration parameter can be stored there, too. You will
73- find an example below and more information in the MySQL manual in
74- /usr/share/doc/mysql-doc or www.mysql.com.
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.
7566
76- ATTENTION: It is necessary, that a .my.cnf from root always contains a "user"
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"
7771line wherever there is a "password" line, else, the Debian maintenance
7872scripts, that use /etc/mysql/debian.cnf, will use the username
79- "debian-sys-maint " but the password that is in root's .my.cnf. Also note,
73+ "root " but the password that is in root's .my.cnf. Also note,
8074that every change you make in the /root/.my.cnf will affect the mysql cron
8175script, too.
8276
@@ -85,19 +79,6 @@ script, too.
8579user = your-mysql-username
8680password = enter-your-good-new-password-here
8781
88- * BIG_ROWS FOR EVEN MORE ROWS IN A TABLE:
89- =========================================
90- If you ever run out of rows in a table there is the possibility of building
91- the package with "-DBIG_ROWS" which, according to a MySQL employee on
92- packagers@lists.mysql.com should lead to a 64bit row index (I guess > 2^32
93- rows) but also to an approx. 5% performance loss.
94-
95- * BerkeleyDB Storage Engine
96- ===========================
97- Support for BerkeleyDB has been removed in 5.1, and consequently both the
98- have-bdb and skip-bdb configuration options will cause the server to fail.
99- Removing the options from /etc/mysql/my.cnf will fix this problem.
100-
10182* FURTHER NOTES ON REPLICATION
10283===============================
10384If the MySQL server is acting as a replication slave, you should not
@@ -107,3 +88,19 @@ slave needs some of its temporary files to survive a machine restart so
10788that it can replicate temporary tables or LOAD DATA INFILE operations. If
10889files in the temporary file directory are lost when the server restarts,
10990replication fails.
91+
92+ * DOWNGRADING
93+ ============================
94+ Unsupported. Period.
95+
96+ You might get lucky downgrading a few minor versions without issued. Take a
97+ backup first. If you break it you get to keep both pieces. Do a restore from
98+ backup or upgrade to the previous version.
99+
100+ If doing a major version downgrade, take a mysqldump/mydumpber consistent
101+ backup using the current version and reload after downgrading and purging
102+ existing databases.
103+
104+ * BACKUPS
105+ ============================
106+ Backups save jobs. Don't get caught without one.
0 commit comments