Used by
MySQL 5.7 - x6.4
Open Server - the last

I want to place databases on one computer and server on another

In the file e: \ srw \ webopsrvr \ modules \ database \ MySQL-5.7-x64 \ my.ini

Changed paths
with
innodb_data_home_dir = "e: \ srw \ webopsrvr \ userdata \ MySQL-5.7-x64"

on
datadir = "\ Server \ e \ srv \ db \ webopsrvr \ userdata \ MySQL-5.7-x64"

and
with
innodb_data_home_dir = "e: \ srw \ webopsrvr \ userdata \ MySQL-5.7-x64"

on
innodb_data_home_dir = "\ Server \ e \ srv \ db \ webopsrvr \ userdata \ MySQL-5.7-x64"

after the server restarts, the paths return to their original position.

Question
1. How to change the location path of the database and tables?
2. Will there be problems with the operation of MySql with this arrangement of databases and tables (ie, the server on computer 1, and the databases and tables on computer 2)?

  • Almost sure that the openserver itself restores configs from its templates each time it is run, and you are wasting your time trying to edit the final files. - etki

1 answer 1

Total we have:

1. To change the location paths of MySQL databases, you need to fix the config file of the corresponding version of MySQL, for example, "MySQL-5.5_my.ini" , the files are located along the path "FolderInstall \ OpenServer \ userdata \ config \" . All slashes of the path in the config file are duplicated, as a result, the network path will look like this datadir = "\\\ Server \\ folder \\ folder1" . Tested on OpenServer 5.2.2 and MySQL 5.5.

2. Problems of server location on one machine, and database files on another:

  • The risk of disabling file storage during database operation.
  • The dependence of the read / write speed of the network connection speed.
  • As the number of machines for organizing a DBMS increases, fault tolerance decreases accordingly. (For example, the OS on the file storage may crash, the OS on the machine where the server is installed may crash, the network may disappear, access to the ball may be lost, there may be overload of the network channel ... etc.)
  • one
    I mean that the work with the table will go, for example, and the machine where the bases lie will suddenly collapse, the network will fall off, whatever. Writing to the table, for example, will not have time to complete because of this. I do not know why you are using MySQL. And specify when you change the paths, save the file, my.ini, then restart the server, open the file my.ini and there again the default paths? - bloodpact
  • one
    Hmm, I have OpenServer 5.2.2 installed, MySQL version 5.5. The config file is called MySQL-5.5_my.ini and is located in "c: \ OpenServer \ userdata \ config \", do you edit that file exactly? I now changed the path to others, and everything started. - bloodpact
  • one
    Oh yeah, I forgot to say, in the config the network path looks like this: datadir = "\\\\ <Server> \\ Repository \\ test". That's how my network path earned. - bloodpact
  • one
    I would still advise you to copy the existing files in the old base directory to the new, network, directory, and those that MySQL has created in the network balloon, delete it. Because in his old directory there were system databases that he needed to use. It is strange that you started this way, my OpenServer refused to start until I copied the tables into the new directory. But I checked, after starting the database, if the checkbox OpenServer-green and system databases are copied to the new directory, and you start the MySQL manager on the same machine where the MySQL server is installed, then it starts up at 127.0.0.1. - bloodpact
  • one
    I copied the entire contents of the folder: 2 folders "MySQL", "performance_schema" and 3 files "ib_logfile0", "ib_logfile1", "ibdata1". When you copy this and restart the server, look in the OpenServer logs, in the tab "MySQL Debugging", that it did not suffice. - bloodpact