My schema doesn't appear on MySQL WorkBench schemas panel - mysql

I always copy a folder of MySQL db data into C:\ProgramData\MySQL\MySQL Server [x.x]\Data folder. And this db schema would appear after I restart the MySQL service.
However, this time I installed a new MySQL on a computer and followed the old way throwing MySchema folder into C:\ProgramData\MySQL\MySQL Server [x.x]\Data and restarted the service. It didn't work.
I checked my.ini datadir = C:\ProgramData\MySQL\MySQL Server [x.x]\Data.
What did I miss?
Edit:
I find a clue, my newly installed MySQL the table extension name is ibd, but my data table is frm, MYD and MYI.

Related

How to create new server in mysql on windows?

I installed mysql 8.0. During the process of install, it will guide you to create a server that is registered as window service. For example, by default it will put server related file on the (base)path "C:\ProgramData\MySQL\MySQL Server 8.0" using default port 3306. What if I want to create another server?What should I do? Maybe using mysqld --initialize?
Well make sure you have installed a running and properly configured MySQL Server and Instance. If so, copy the data directory of your running MySQL Instance (Server) in a second folder.
Existing Folder: C:\ProgramData\MySQL\MySQL Server 5.7
New Folder (for example): C:\ProgramData\MySQL\MySQL second Server 5.7
NEXT: Create 2 Option-Files (a ka .txt files, you save as my-opts[Optummber.cnf)]. You may create one file named C:\ProgramData\MySQL\my-opts1.cnf that looks like this:
File 1 Content:
[mysqld]
datadir = C:\ProgramData\MySQL\MySQL Server 5.7\mydata1
port = 3307
Create a second file named C:\ProgramData\MySQL\my-opts2.cnf that looks like this:
[mysqld]
datadir = C:\ProgramData\MySQL\MySQL second Server 5.7\mydata2
port = 3308
NEXT: Use the --defaults-file option to start each server, runnig on its own option file:
C:\> C:\ProgramData\MySQL\bin\mysqld --defaults-file=C:\ProgramData\MySQL\my-opts1.cnf
C:\> C:\ProgramData\MySQL\bin\mysqld --defaults-file=C:\ProgramData\MySQL\my-opts2.cnf
Note: Each will start visibly, with a new prompt until the server exits later), so you will need to issue those two commands in separate console windows.
To shut down the servers, connect to each using the appropriate port number:
C:\> C:\ProgramData\MySQL\bin\mysqladmin --port=3307 --host=127.0.0.1 --user=root --password shutdown
C:\> C:\ProgramData\MySQL\bin\mysqladmin --port=3308 --host=127.0.0.1 --user=root --password shutdown
Servers configured as just described permit clients to connect over TCP/IP. - If you want to do so, please follow the guide on: https://dev.mysql.com/doc/refman/8.0/en/multiple-windows-command-line-servers.html
Note: I wrote the commands in here based on https://dev.mysql.com/doc/refman/8.0/en/multiple-windows-command-line-servers.html. Please modify them according to your file System and MySQL Configuration. I don't take any warranty for them. If the used filepaths seem to complicated for you, please change them to the eased up versions in the linked description. Setting up mySQL Instances might be a challenging process, just do so, if you can handle it.

bitnami version of WAMP is ignoring my.ini?

I have installed bitnami's version of WAMP on Windows 10 (bitnami-wampstack-7.1.28-0-windows-x64-installer)
Everything is working fine, except now I must move the data directory to another disk. I changed my.ini as follows:
datadir="D:/bitnami/data"
In accordance with http://forum.wampserver.com/read.php?2,123685
I changed the header to :
[wampmysqld64]
It still doesn't work.
Why is the variable datadir not pointing MySQL to the new directory?
Please remove the data of the wampmysqld section and rename the wampmysqld64 one to mysqld.
I just followed these steps to rename the folder and they worked.
Stop MySQL
Edit the datadir and log-error under the mysqld section
...
# The MySQL server
[mysqld]
...
# set datadir to the location of your data directory
datadir="D:/bitnami/data"
...
log-error="D:/bitnami/data/mysqld.log"
...
Copy the content of the current data folder to the new one.
Start MySQL again

connecting MySQL database to copied and pasted data directory

I copied a database directory from the datadir (/var/lib/mysql/) of a MySQL instance running on a server to my local machine. Is it possible to put this database directory into my local MySQL datadir and access that database?
What I have done so far is copy the database directory like above, I log in to the MySQL and can see the database, I switch to it and can list all the tables. But when ever I try to query a table I get something like:
select * from users limit 1;
ERROR 1146 (42S02): Table 'users' doesn't exist
Also from mysqldump:
mysqldump: Got error: 1146: Table 'very_first_table' doesn't exist when using LOCK TABLES
Is it possible to do what I am trying to do here?
So I got it to work, bare in mind that my end goal was to get a database dump from the database. The mysql folder was extracted from a older virtual machine snapshot which could not be run at the moment, so I couldn't just log in to it and do a normal dump. Here is what I did:
1) I installed mysql on a fresh vm on my local machine
2) I shut down mysql with service mysql stop
3) I removed the existing /var/lib/mysql folder from the fresh install
4) I replaced it with the /var/lib/mysql folder that was removed from the old snapshot
5) I ran chown -R mysql:mysql /var/lib/mysql
6) I restarted mysql with service mysql start
7) Then I checked if I could log in and query the tables, I could!
So I was able to run the dump after that.

how to change port number in MySQL Server 5.6 on windows( Not in XAMPP inbuilt mysql)

I stopped the MySQL Service in Windows from TaskManager Option.
And then, I opend and Choosed the port number in "my-default.ini". like following (C:\Program Files\MySQL\MySQL Server 5.6\my-default.ini)
[mysqld]
port = 33062
Saved It.
Then I stated the service 'MySql' from the 'TaskManager'.
I checked the port number from 'mysql command' prompt. but port number is not changed to 33062. Instead of that default port number is there in the 'my.ini' file.
Please show the way to change it.
Steps to change the port number for MySQL Server 5.7 :
Stop the MySQL service from services.msc(To open services.msc go to run command and then type services.msc)
Go to the location C:\ProgramData\MySQL\MySQL Server 5.7 (ProgramData is a hidden folder. So you need to enable the hidden items from Folder Options).
In the MySQL Server 5.7 folder you will find my.ini file.
Open my.ini file and search for port.
Give your desired port number (like port=3632).
Save and exit my.ini file.(if it brings a file owner error, the quickest hack is to rename the file, edit it accordingly and then save the file as 'my.ini'. You can then proceed to delete the first renamed file.)
Then stat the service from the services.msc.
Follow the following simple steps
Rerun the installer by going to start > MySQL > MySQL Community Installer
https://i.stack.imgur.com/s78DN.png
Click on Reconfigure next to MySQL Server
Click and Next
Now change the port numbers to maybe 3309
https://i.stack.imgur.com/zs5Vu.png
Click Next change the password, test it and that ends it

How to restore full mysql (dir)

My problem is: I'm saved the /var/www/virtual and the /var/lib/mysql directories. And after reinstall OS I set up the MySQL and when restored these two directories i'm got error in mysql server. So MySQL server don't want to start up.
So what way can i restore the mysql database directory?
The MySQL server don't start after I copy the ibdata1 file.