I am new to use mariadb on linux machine. I am using Fedora 20 and I have downloaded the mariadb 10.0.15 tar.gz file and its instruction. I removed the existing mariadb from my Fedora 20. I have installed the mariadb on my machine by following the official instruction. It seems successful (without error) but I cannot start it as expected. I also have few other basic questions.
Some background information here: this database will be accessed by a local application. This local application may be running under a general user account, user1. I installed it in /var/local as a root user.
Questions:
1. How to uninstall it completely? I want to try again to see if I did anything wrong before.
2. Because it will be accessed by a local application and the local application will be running by a general user, user1, should I install it with user1?
3. Basically I am confused with these three users: user1, mysql and root.
“user1” will be used to run the application and login the machine. “mysql” will be used to connect the mariadb. “root” will be used to install mariadb into /usr/local. Who will start the mariadb? It will be “root”, I guess. But if “root” starts the service, “user1” and “mysql” don’t have problem to access its resources?
4. If I don't want to install it as root, can I still install it under the /usr/local directory?
5. I renamed the my-large.cnf to .my.cnf and uncomment the InnoDB table section. Is this only change I need to make if I want to use InnoDB? should I disable the myisam? how?
6. where should I put the .my.cnf file? put into the home directory of the user who starts the mariadb or the user who logon the system if they are different?
7. there is a my.cnf file from the Fedora 20 installation, when I start mariadb without the "--defaults-file=~/.my.cnf" option, I will get the following error from the log:
[ERROR] mysqld: Can't create/write to file '/var/run/mysqld/mysqld.pid' (Errcode: 2 "No such file or directory")
I have to manually create the mysqld folder inside the /var/run folder each time after reboot. how to avoid this?
8. After started with that "old" my.cnf, I try to stop the mariadb but cannot because I cannot find its service name:
[user1@dev2 mysql]$ ./bin/mysqladmin -u root -p status
Enter password:
Uptime: 685 Threads: 1 Questions: 3 Slow queries: 0 Opens: 0 Flush tables: 1 Open tables: 62 Queries per second avg: 0.004
[user1@dev2 mysql]$ sudo systemctl status mariadb.service
mariadb.service
Loaded: not-found (Reason: No such file or directory)
Active: inactive (dead)
[user1@dev2 mysql]$ sudo systemctl status mysql.service
mysql.service
Loaded: not-found (Reason: No such file or directory)
Active: inactive (dead)
[user1@dev2 mysql]$ sudo systemctl status mysqld.service
mysqld.service
Loaded: not-found (Reason: No such file or directory)
Active: inactive (dead)
how stop it?
9. if I start mariadb with the renamed my-large.cnf ([root@dev2 mysql]# ./bin/mysqld_safe --defaults-file=~/.my.cnf --user=mysql), I got the following error:
150225 0:09:28 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
150225 0:09:28 [Note] Recovering after a crash using mysql-bin
150225 0:09:28 [Note] Starting crash recovery...
150225 0:09:28 [Note] Crash recovery finished.
150225 0:09:28 [Warning] Failed to load slave replication state from table mysql.gtid_slave_pos: 1146: Table 'mysql.gtid_slave_pos' doesn't exist
150225 0:09:28 [ERROR] Can't open and lock privilege tables: Table 'mysql.servers' doesn't exist
150225 0:09:28 [Note] Server socket created on IP: '::'.
150225 0:09:28 [ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.user' doesn't exist
150225 00:09:28 mysqld_safe mysqld from pid file /usr/local/mysql/data/dev2.pid ended
Then I try do upgrade as suggested above:
[root@dev2 mysql]# ./bin/mysql_upgrade
Version check failed. Got the following error when calling the 'mysql' command line client
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2 "No such file or directory")
FATAL ERROR: Upgrade failed
so I think I need to make the mariadb running first, I use above 7 to make server running and then do upgrade, I got the following errors:
[user1@dev2 mariadb-10.0.15-linux-x86_64]$ sudo ./bin/mysql_upgrade
[sudo] password for user1:
Phase 1/5: Checking mysql database
Processing databases
mysql
mysql.column_stats OK
mysql.columns_priv OK
mysql.db OK
mysql.event OK
mysql.func OK
mysql.gtid_slave_pos
Error : Table 'mysql.gtid_slave_pos' doesn't exist in engine
status : Operation failed
mysql.help_category OK
mysql.help_keyword OK
mysql.help_relation OK
mysql.help_topic OK
mysql.host OK
mysql.index_stats OK
mysql.innodb_index_stats
Error : Table 'mysql.innodb_index_stats' doesn't exist in engine
status : Operation failed
mysql.innodb_table_stats
Error : Table 'mysql.innodb_table_stats' doesn't exist in engine
status : Operation failed
mysql.plugin OK
mysql.proc OK
mysql.procs_priv OK
mysql.proxies_priv OK
mysql.roles_mapping OK
mysql.servers OK
mysql.table_stats OK
mysql.tables_priv OK
mysql.time_zone OK
mysql.time_zone_leap_second OK
mysql.time_zone_name OK
mysql.time_zone_transition OK
mysql.time_zone_transition_type OK
mysql.user OK
Repairing tables
mysql.gtid_slave_pos
Error : Table 'mysql.gtid_slave_pos' doesn't exist in engine
status : Operation failed
mysql.innodb_index_stats
Error : Table 'mysql.innodb_index_stats' doesn't exist in engine
status : Operation failed
mysql.innodb_table_stats
Error : Table 'mysql.innodb_table_stats' doesn't exist in engine
status : Operation failed
Phase 2/5: Running 'mysql_fix_privilege_tables'...
ERROR 1932 (42S02) at line 580: Table 'mysql.innodb_index_stats' doesn't exist in engine
ERROR 1932 (42S02) at line 583: Table 'mysql.innodb_table_stats' doesn't exist in engine
FATAL ERROR: Upgrade failed
why I cannot run mariadb with the my.cnf which comes with this version of mariadb? The old my.cnf doesn't have innoDB section and I cannot enable it. Is this the reason? does the Fedora 20 support mariadb 10.0.15?
Thanks,
Peter