cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,909
2,227
463
Hi,

Can you give me tutorial (steps) for replace it?

Regards,
I have reviewed the unsupported guide on replacing MySQL with MariaDB and simply reversed the steps for you.

Step 1: Backup existing MySQL data

Make sure to save all existing data just in case there are any issues.

Code:
cp -Rf /var/lib/mysql /var/lib/mysql-old
mv /etc/my.cnf /etc/my.cnf-old
Step 2: Enable the targets so cPanel handles MySQL updates:

The following will mark the versions of MySQL we distribute as installed so they are maintained by cPanel/WHM. Note: Only use the command specific to your version of MySQL.

Code:
/scripts/update_local_rpm_versions --edit target_settings.MySQL50 installed
/scripts/update_local_rpm_versions --edit target_settings.MySQL51 installed
/scripts/update_local_rpm_versions --edit target_settings.MySQL55 installed
Step 3: Remove existing MariaDB RPM’s so there is a clean slate for MySQL

Code:
yum remove MariaDB-server MariaDB-client MariaDB-devel
Step 4: Remove the yum repository for MariaDB

Code:
rm /etc/yum.repos.d/MariaDB.repo
Step 5: Install MySQL RPMs:

Code:
/scripts/check_cpanel_rpms --fix
Final Step: Rebuild easyapache/php to ensure modules are intact/working

Code:
/scripts/easyapache --build
 

jazz1611

Well-Known Member
Jun 5, 2012
82
0
56
cPanel Access Level
Root Administrator
Downloading /http://httpupdate.cpanel.net/RPM/11.36/cloudlinux/6/x86_64/rpm.md5
..Timeout on connect....Timeout on connect..

I added ip 216.104.43.138 to CSF but still timeout
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,909
2,227
463
Downloading /http://httpupdate.cpanel.net/RPM/11.36/cloudlinux/6/x86_64/rpm.md5
..Timeout on connect....Timeout on connect..

I added ip 216.104.43.138 to CSF but still timeout
Which step from my previous post are you encountering that issue? Have you checked to ensure your resolvers in /etc/resolv.conf are valid?

Thank you.
 

jazz1611

Well-Known Member
Jun 5, 2012
82
0
56
cPanel Access Level
Root Administrator
[email protected] [~]# mysql_upgrade
Looking for 'mysql' as: mysql
Looking for 'mysqlcheck' as: mysqlcheck
FATAL ERROR: Upgrade failed
[email protected] [~]# mysqlcheck --all-database -r
mysqlcheck: Got error: 2002: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) when trying to connect
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,909
2,227
463
[email protected] [~]# mysql_upgrade
Looking for 'mysql' as: mysql
Looking for 'mysqlcheck' as: mysqlcheck
FATAL ERROR: Upgrade failed
[email protected] [~]# mysqlcheck --all-database -r
mysqlcheck: Got error: 2002: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) when trying to connect
That typically indicates MySQL is not running. Do you receive any errors when attempting to restart MySQL? Or, do you notice any specific errors in the MySQL error log (/var/lib/mysql/hostname.err)?

Thank you.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,909
2,227
463
Do you notice any specific errors in the MySQL error log (/var/lib/mysql/$hostname.err)?

Thank you.
 

jazz1611

Well-Known Member
Jun 5, 2012
82
0
56
cPanel Access Level
Root Administrator
Maybe error from InnoDB

130712 23:53:55 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
130712 23:53:55 [Note] Plugin 'FEDERATED' is disabled.
130712 23:53:55 InnoDB: The InnoDB memory heap is disabled
130712 23:53:55 InnoDB: Mutexes and rw_locks use GCC atomic builtins
130712 23:53:55 InnoDB: Compressed tables use zlib 1.2.3
130712 23:53:55 InnoDB: Using Linux native AIO
130712 23:53:55 InnoDB: Initializing buffer pool, size = 128.0M
130712 23:53:55 InnoDB: Completed initialization of buffer pool
130712 23:53:55 InnoDB: highest supported file format is Barracuda.
InnoDB: The log sequence number in ibdata files does not match
InnoDB: the log sequence number in the ib_logfiles!
130712 23:53:55 InnoDB: Database was not shut down normally!
InnoDB: Starting crash recovery.
InnoDB: Reading tablespace information from the .ibd files...
InnoDB: Restoring possible half-written data pages from the doublewrite
InnoDB: buffer...
130712 23:53:55 InnoDB: Error: page 2700 log sequence number 2876264734
InnoDB: is in the future! Current system log sequence number 2876259938.
InnoDB: Your database may be corrupt or you may have copied the InnoDB
InnoDB: tablespace but not the InnoDB log files. See
InnoDB: MySQL :: MySQL 5.5 Reference Manual :: 14.3.7.2 Forcing InnoDB Recovery
InnoDB: for more information.
130712 23:53:55 InnoDB: Error: page 2615 log sequence number 2876270164
InnoDB: is in the future! Current system log sequence number 2876259938.
InnoDB: Your database may be corrupt or you may have copied the InnoDB
InnoDB: tablespace but not the InnoDB log files. See
InnoDB: MySQL :: MySQL 5.5 Reference Manual :: 14.3.7.2 Forcing InnoDB Recovery
InnoDB: for more information.
130712 23:53:55 InnoDB: Error: page 2727 log sequence number 2876413004
InnoDB: is in the future! Current system log sequence number 2876259938.
InnoDB: Your database may be corrupt or you may have copied the InnoDB
InnoDB: tablespace but not the InnoDB log files. See
InnoDB: MySQL :: MySQL 5.5 Reference Manual :: 14.3.7.2 Forcing InnoDB Recovery
InnoDB: for more information.
130712 23:53:55 InnoDB: Error: page 2605 log sequence number 2876534837
InnoDB: is in the future! Current system log sequence number 2876259938.
InnoDB: Your database may be corrupt or you may have copied the InnoDB
InnoDB: tablespace but not the InnoDB log files. See
InnoDB: MySQL :: MySQL 5.5 Reference Manual :: 14.3.7.2 Forcing InnoDB Recovery
InnoDB: for more information.
130712 23:53:55 InnoDB: Error: page 2562 log sequence number 2876414138
[ Read 52054 lines ]
I added line "innodb_force_recovery = 4" to my.cnf and mysql working fine. But i check service mysql status on WHM see alert.

-----------------------------------------------------------------------

Now all working fine. Thanks you help me resolved it. Please attach comment to Tutorial Replace From MariaDB to MySQL

Regards,
 
Last edited:

jazz1611

Well-Known Member
Jun 5, 2012
82
0
56
cPanel Access Level
Root Administrator
Hi,

I am running my server with 4 Core CPU, 4GB RAM, 200GB HDD with MariaDB and Litespeed WebServer but without value line optimize my.cnf

Now my server load very high. Can help me config to load low server?

Ảnh chụp màn hình_2013-07-18_001134.png
 

thinkbot

Well-Known Member
Oct 30, 2012
326
1
16
cPanel Access Level
Root Administrator
why did you remove those mysql optimizations that we proposed ? :|
you asking for help, we help you, then you remove all the things that we proposed

in your case also php is cousing quite a load, check your litespeed config
how much traffic do you have ?
 

jazz1611

Well-Known Member
Jun 5, 2012
82
0
56
cPanel Access Level
Root Administrator
because if i add value line optimize mysql still load high server. do you have yahoo messenger or teamviewer? i need you help. please

i use default litespeed config. when can i check traffic?
 

promo.auto

Registered
Dec 14, 2013
1
0
1
cPanel Access Level
Root Administrator
Hello,

my server:
vendor_id : GenuineIntel
cpu family : 6
model : 42
model name : Intel(R) Core(TM) i5-2500 CPU @ 3.30GHz
stepping : 7
microcode : 0x28
cpu MHz : 1600.000
cache size : 6144 KB
Memory : 16Gb ddrIII
Hdd : 1800 Gb raid 10

My.cnf
[mysqld]
datadir = /var/lib/mysql
socket = /var/lib/mysql/mysql.sock
user = mysqld
innodb_additional_mem_pool_size = 512M
innodb_log_buffer_size = 32M
innodb_buffer_pool_size = 1G
innodb_log_file_size = 768M
innodb_use_sys_malloc =0
max_user_connections = 50
max_connections = 1000
wait_timeout = 120
interactive_timeout = 600
connect_timeout = 2
query_cache_size = 64M
join_buffer_size = 128M
thread_cache_size = 4
table_cache = 1024
key_buffer_size = 512
sort_buffer_size = 256K
read_buffer_size = 128K
read_rnd_buffer_size =8M
# nou
tmp_table_size = 128M
max_heap_table_size = 128M
slow_query_log_file = /var/log/mariadb-slow.log
long_query_time = 10
# end
myisam_sort_buffer_size= 256M
# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links = 0
max_allowed_packet = 1024M
thread_concurrency = 2
# Semisynchronous Replication
# MySQL :: MySQL 5.5 Reference Manual :: 16.3.8 Semisynchronous Replication
# uncomment next line on MASTER
;plugin-load=rpl_semi_sync_master=semisync_master.so
# uncomment next line on SLAVE
;plugin-load=rpl_semi_sync_slave=semisync_slave.so

# Others options for Semisynchronous Replication
;rpl_semi_sync_master_enabled=1
;rpl_semi_sync_master_timeout=10
;rpl_semi_sync_slave_enabled=1

# MySQL :: MySQL 5.5 Reference Manual :: 21 MySQL Performance Schema
;performance_schema

#log=/var/log/mysqld-query.log

[mysqld_safe]
log-error = /var/log/mysqld.log
pid-file = /var/run/mysqld/mysqld.pid


on this server I have both MyIsam and InnoDb
3 Magento stores (InnoDb)
1 Dbmail ~ 250Gb (InnoDb)
20 Websites with MyIsam database

I need an advice on optimization.

Thank you very much