MySQL : how to divide database into two disks? - mysql

I have a database installed in C:\ and I created an other database in C:\ to log users' data because the data size is very big, So I want to save it somewhere else.
Then I moved the second database with its data to D:\ through a symbolic link file to point out the new directory.
Here the file name : archive_file.sym
And here its content : D:\MySQLData\data\archive_db
archive_db : is the name of my second database
the problem is when I executed a MySQL command to see the content of one of the tables in the seconde database:
use 'archive_db';
select * from 'log_user';
I've got this error :
'log_user' Table doesn't exist
I've tried symbolique_link throughout MySQL documentation :
Using Symbolic Links for Databases on Windows.
Any advices ? Any idea how to proceed otherwise?
I'm working on Windows server 2008-r2 , MySQL server version 5.6

Related

Installing (minimal) MySQL Workbench to simply join data from two .csv files (connections???)

I previously used MySQL Workbench to do this, in an environment that was already set up.
How do I set up a minimal working environment to just create and join tables on my own computer? (Connections???)
More details:
I downloaded and installed MySQL Workbench, and I can't even run SELECT sysdate();. There's a red x next to it. If I try "CREATE DATABASE MY_DATABASE; there's a green check, but the execute button is grey.
Doing some reading I apparently need "connections." Reading about that, I apparently need to also install MySQL Database Server. Who knows what else.
So, again, the question is how do I set up a minimally working environment to just create tables from .csv files, join them with MySQL commands, and export the results to another .csv file? (I know the syntax of the command to import a .csv file, and how to join tables.)
Thanks.
Install MySQL WorkBench AND MySQL Server.
From the command line, in the directory where MySQL server is installed, execute "mysqld --initialize" (One time only.)
execute "mysqld" from the command line, after the initialization given in step 1, and after any reboots. (It runs in the background, and doesn't exit when you exit MySQL WorkBench. (It can optionally be installed as an automatically running Windows service during installation.)
Execute Database -> Connect to Database upon starting MySQL WorkBench (each time you start the application). The default local host connection works fine.
After doing File -> New Model and setting up table(s), do Database -> Forward Engineer. This will place your new database in the Schemas section on the home/main window.
Double click on the Schema you created (default name is mydb) and it changes to bold font. Now scripts you run from that main window will run against the database you created.

MySQL Not loading Database File from /usr/local/mysql/data

Hey Guys so the other day I was running a database schema in the mysql workbench on my mac. I had added tables populated the data and tried to run some big queries. The server died and now when I connect to my local host instance I cannot find my database. However I can still see my database file in /usr/local/mysql/data/
Can any one help me work out how to start mysql server again and get it to load in the file?
I just dont' understand why it can no longer see the schema..
Connecting as localhost, using root, both workbench and terminal can't see the file. However the file is here:
The file I want is AM_DUMPS
When I try and load it from SQL Workbench I get:
Check to see if the data directory is owned by MySQL or mysqld is not launched as the mysql user. It looks like something along those lines. You may have to adjust the permissions to make sure that mysql is the owner.

MySQL 5.6.14 cannot detect data created from MySQL 5.6.11

I have a created a database called "global" in MySQL 5.6.11.
The data files are stored in a separate folder from MySQL installation directory. Hence the database "global" can be clearly located in folder "global" in Windows Explorer.
What I did was, copy that entire folder to another directory for backup purposes.
Due to a bug in mysqldump.exe (5.5.16) which state that it has older version that the MySQL server (5.6.11), so I decided uninstall everything and remove every data (not the backup).
Then I install MySQL 5.6.14. And I copied back the "global" folder from backup to the root data directory of the new MySQL installation. When I open MySQL Workbench, it can detect the database. I even expand the "tables" node and able to see the list of tables in it.
Surprisingly, when I tried to query the data, MySQL showed an error those tables do not exist. Every single table does not exist everytime I query it by using simple syntax: select * from account. I even used the command line, but it still doesn't work.
Does someone know why?

Imported data are missing in Mysql

I had copyed the data folder under wamp/bin/mysql/mysql(v)/data befor formate my computer, then after installing new os and then wamp I replace the data folder.
Now when I opening phpmyadmin the list of databases are showing but under the data base the tables are not shownig.
When I am using the myadminer it shows the lisst of table but not the tables data.
when I am using sqlbuddy one warning is showing in the place of listing tables. warning is like
Warning: array_key_exists() expects parameter 2 to be array, boolean given in E:\wamp\apps\sqlbuddy1.3.3\dboverview.php on line 215
you should have taken a proper backups - using mysqldump. if you used innodb storage engin and it was configured to keep log files or tablespace files somewhere else - i'm afraid you've lost your data.
I'm sorry, you have lost your data. In the future create backups frequently and create MySQL dump whenever you want to migrate your database.

How can I recover MySQL tables from data files?

I've got a database (all MyISAM tables) and the machine where MySQL was running is no longer bootable. However, we have all the MySQL data files from the data directory. How can I restore the data from the MYD and FRM files, or whatever other files I should be looking at in the data directory?
I've been doing some searching on this and it sounds like for MyISAM I should just be able to copy the database subdirectory from the old MySQL data directory to the new MySQL data directory. However, that's not working for me. A database with the name of the database I'm trying to recover shows up in the list of databases in phpMyAdmin, but all the tables show "in use" and have no information (e.g., number of rows, number of bytes, column information, etc.). Any operation on those tables (e.g., SELECT * FROM {table}, REPAIR {table}, CHECK {table}) returns a "no such table" error.
One of the tools I ran across in my search is DBACentral by MicroOLAP. It's got component that's supposed to restore data from FRM/MYD files, but when I tried to run it, it didn't list any tables that it could recover from my FRM/MYD files.
This is on a developer workstation that's running Vista Business 32bit. MySQL version is 5.0.27. After fixing the machine, I went and got the exact same version of MySQL (v5.0.27), thinking that if I'm just going to drop in the binary data files I should do it with the same version of MySQL. It still didn't work.
Any insights would be greatly appreciated... thanks!
-Josh
Install the same version of mysql.
Remove mysql directory from data directory of the server and copy it from the crashed server. This is the key element
copy directory of database you want to recover into data directory of new server
start mysql.
switch to mysql database: USE mysql; and run REPAIR TABLE <table name> on every table.
Do the same with database you want to recover
tip: make sure the 2 directories have the same permissions like data directory
If you did not save mysql database (mysql directory in your old server's data dir, then you can try to:
create database with the same name as database you want to recover.
Then you can create each table (it would be good to use the same structure - you'd have bigger chance of recovery).
then stop mysql server and delete files from database directory and overwrite them with files from old server
start mysql and repair each table.
I wound up giving up. I think the answer is that, with my particular version of MySQL, this doesn't work. Hopefully things have improved since then.