I transfer a DB (MySQL).
The transfer is done by the most common method - the "copy-past" directory in the "data" directory.
Next, I start and look, the tables in the database give "Rows -1". I look through Navicat.
Not the first time I transfer a DB, but here something not that. The software is not mine and the database was not created by me.
Maybe something with access?
I just don’t know what the password-protected databases from Navicat look like.
When installing MySQL on root, I set my password naturally.
Export-Import will help with this?
PS If the database is under access, is that all? Put out the light?
The database is extensive, packed for several years. The organization has now decided to write its own software, as the content of the current has become problematic.
Is the database to death tied to the developers, and not to the enterprise (this is already copyright)?
Or is it easier to press (according to the law) on the developers, so that they would issue a password for access to the database? PPS (!)
A little clearer. There are no MYI and MID files in the database! Did it somehow tricky DB done, what could they be in other directories?
(I don’t have access to the PC today, I can only see it tomorrow)
Why is that?


UPD:
Problem solved!
Root password hijacking. (the greedy installer (who sold the organization's software), installed some unknown to me database management tool, and the password in it was simply stored in a closed form. Indeed, such developers always think that the LOH buyer, but the buyer hires after a few years another developer, and that office is left without money for allegedly "support and maintenance", and this is an update of the list of the names of the participants of the commission in its own database (!!!) or an update of 5-10 questions from test tasks. Plus, such developers get another big fat minus and oh ernenie in reputation throughout the city!)
PS Guys, software must be sold honestly!
The database created by the software buyer is 100% owned by the organization that purchased the software. And has the full right to provide a password to the database.

  • Perhaps the tables in innodb (data is in ibdata files that are not in the data directory). Use mysqldump - tutankhamun
  • @tutankhamun Very similar. - I_CaR

1 answer 1

Transferring data by copying the data directory in the case of MySQL is possible only if the databases use only the MyISAM table type (of course, the operation is performed after the server is stopped, otherwise the data will be damaged). In the case of MyISAM, both the meta-information, and the indices and data are completely located in the database directories. If there are InnoDB tables, the data can reside in a single tablespace.

Data transfer through copying is used very rarely. Only if you have MyISAM-tables, and, as a rule, through the mysqlhotcopy utility, included in MySQL.

A regular transfer of data from one database to another is the procedure for creating and expanding a SQL dump: a text file with SQL instructions that reproduce the database. You can dump the dbname.sql of the dbname database using the mysqldump utility

 mysqldump -u user -p dbname > dbname.sql 

You can deploy it on a new server in the previously created dbname_new database using the mysql utility.

 mysql -u user -p dbname_new < dbname.sql 

Instead of user , the name of the MySQL user is indicated, from which operations are performed, the -p parameter informs that allows you to enter a password immediately after running commands. Utilities are part of any MySQL installation and are available from the command line.

  • At the expense of database dumps, I do them through Navicat (from time to time). The question is not how to dump and deploy it. Take a little higher. Those. if I don’t know the root password on the database PC, can I connect the MySQL manager to the database to create a dump? It is unlikely. Or is there still a possibility? - I_CaR
  • @I_CaR Then even easier, make a dump via Navicat or take it ready and deploy it on the new server. - cheops
  • I added a bit of the comment above. - I_CaR
  • 2
    @I_CaR If you have rights to restart the MySQL server, you can restart it without access rights. To do this, the skip-grant-tables directive should be added to the my.cnf / my.ini configuration file — you can log in as any user, including root without a password, and perform any operations: dump, assign a new password, etc. - cheops
  • @chops - thank you very much, for the prof. Tomorrow I'll get to that place and pick the base properly, along with the roots. - I_CaR