MySQL Forums
Forum List  »  Install & Repo

Can I copy installed mysql from ubuntu to centos7 directly without installation?
Posted by: xinying huang
Date: May 20, 2021 01:02AM

The purpose to try this copying way is that I'm writing an one click installation sh script which including serveral softwares, such as JDK, MySQL, nginx, elasticsearch and some Java, python code. Coping existing MySQL is obviously the easiest way to finish MySQL installation script, since I need to install MySQL and create accounts and DB's in traditional way .

The steps for my copying MySQL directly from Ubuntu to Centos7 are:

1)create user/group MySQL on Centos7
2)copying MySQL installed directory from ubuntu to the same directory on centos7, such as /usr/local/mysql
3)copying my.cnf file from Ubuntu to /etc on Centos7
4)copying mysql.server to /etc/init.d/mysql
5)grant permission to mysql.server and chown the owner of /usr/local/mysql to mysql:mysql
6)start/stop MySQL service manually, it's looks fine

BTW, my Centos7 machine is new installed, which means I did not installed any other software on it, and my Centos7 can not reach internet so I could not install MySQL through apt, yum ways. I need to download installation package from website firstly, then I can install MySQL through rpm, or tar in the traditional way.

What I want to say is that no matter the apt, yum, rpm, or tar way, it's complicated to write these steps in my one click installation script, so I choose copying directly, but I have some worries about it since I do not know if there are some potential issues.

Options: ReplyQuote




Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.