Can't get hostname from your ip address - mysql

This is a Duplicate to this question. But the given answer did not solved my problem. I have mysql installed which is accessed from other computers in the network with my ipaddress/phpmyadmin.
I also added line skip_name_resolve=1 to my my.ini file but this also din't worked. I cannot even take backup now.
I installed mysql on another pc and copied the databases from xampp/mysql/data from previous mysql folder. But the database does not has all the tables. Plz suggest something to resolve the problem or if there is any way i can take backup.

The error you are getting is a problem with resolving the hostname given for the MySQL connection string. Check your DNS entry for the host in question, modify your /etc/hosts to statically point to it, etc
Also this isn't a question of programming, rather of system, so...

Related

Raspberry Pi MySQL Remote Connection (error: 10061)

I'm trying to connect to a MySQL server running on my Raspberry Pi 3 remotely (though on the same LAN).
Attempting to do so through HeidiSQL returns an error coded 10061. A bit of research suggests I have to edit the config to allow remote connections.
The config, however, does not contain a bind-adress x.x.x.x line (/etc/mysql/my.cnf) for my to comment out. Added it myself breaks the service, causing errors when trying to restart it.
Checking other possible config file locations resulted in only empty files.
Additionally, comparing to the "default" config file, mine is a lot shorter, and has no actual statements, other than a few includes for other config files (it seems). These included files are all empty as well.
I'm now lost, and cannot figure out how to allow remote connections to my server. Any help is much appreciated :)
Thanks to #PetervanderWal, I suspected that the lack of a bind-address statement in the config was no freak coincidence. Therefore, I did a grep search for any files containing "bind-address", and found the correct configuration file: /etc/mysql/mariadb.conf.d/50-server.cnf. This file had the ´bind-address´ statement, which - after commenting it out - fixed the problem.
The takeaway here (if you ask me) is, if none of your config files contain the bind-address statement, widen your search for the correct config file.
Thanks Peter, hope this helps others.

MySQL 8.0 Deployment with Data Seperate

I have been running MySQL 5.X for several years. Just come to a new server and downloaded V8.0.11.0. I installed it and it asked me no questions about where to keep the data, it has put it all on the C: drive. I want to keep it separate to make backup easier. How do I make the data location move to another disk?
What I have tried:
The old 5.7 method of stopping the server, moving the files, updating
my.ini and restarting. You can't move the files (Access denied) and
the server doesn't start if you change the my.ini file.
mysqld --initialise --datadir="F:\MySQL\Data" (tried forward slashes and double slashes as well)
I can't find any documentation! It's a pretty basic requirement so I'm guessing it must be documented!
OK, I uninstalled MySQL and then ran the installer again. The first question is where do you want to put things! I take it all back, apologies for missing it!

Where can I find my mySQL database (using locate doesn't help)?

First ever Stack Overflow post, thanks for your time. Any constructive criticism on how to post better, please just let me know. I have done a search on my query and have found similar posts, but I was unable to use the information within them to resolve my problem.
I have created a mysql database using the terminal window in my Ubuntu system (which I am also new to, having been a lifelong windows user). I used the following code in the terminal window:
$ mysql -u root -p
Then once in mysql, I did the following
CREATE DATABASE securities_master;
USE securities_master;
I created a user and tables in the database using some other code, that doesn't seem relevant here, so I won't bother posting. However, I then decided I would like to take a look at the tables in the database, so I downloaded an SQLite browser. It was at this point that I realized I could not find my database file.
I tried to find the answer on previous stack overflow posts, and tried the suggestions of:
locate sqlite
locate .db
locate .sqlite
locate securities_master
But unfortunately, none of these showed the file I was looking for. The only place I can think of would be what is called the 'root' directory in my computer, but the Ubuntu file manager system won't let me view it because it says I don't have permissions. Is this where it might be?
Could someone shed some light on where I might be able to find this file/database? I know it is definitely there because if I try to CREATE it again, I get the message that it can't because it already exists.
Thanks again.
sqlite and mysql are two different databases. You can't use sqlite on a mysql database. sqlite is a single-file database, in which users just open the file and read and write to it, while mysql is a more traditional relational database system with a server and a client, where the server manages the database (which is generally in a directory of files), while the client just connects to the server.
Where the mysql database is located my depend on your system, but it's usually in /var/lib/mysql. You can look in /etc/mysql/my.cnf for the configuration file, which should have a datadir option that refers to where the actual data for the database is stored.
You can check my.ini file to see where the data folder is located.
Usually there is a folder {mysqlDirectory}/data
MySQL data storage:
Commands.frm
Commands.myd
Commands.myi
The *.frm files contain the table definitions. Your *.myi files are MyISAM index files. Your *.myd files contain the table data.
as mentioned in the answer before mine, mysql and sqlite are two different systems.
You mention you used the cmd line mysql to create the database and then wanted to view the tables. If you're simply trying to see which table are created, in the same command line you used to Create the database you can run show tables;
If you're after a GUI for this, we'd need a bit more context. Is this ubuntu system a remote server, or are you using the desktop version?
You say you're a long time windows user, If you're using windows locally, I personally like SQLWorkbench for accessing my remote mysql servers.
EDIT: I just re-read your post and realised you're using local ubuntu desktop so me mentioning remote was silly, my bad! However, SQLWorkbench does have a ubuntu version at https://dev.mysql.com/downloads/workbench/

setting up MySQL Workbench with MAMP - missing 'mysql.sock' file

I am having trouble connecting MySQL Workbench to MAMP. I am using version MySQL Workbench version 6.0 and MAMP version 3.0.3.
I have followed the instructions on this link: http://www.rubberneckdesigns.com/mamp/how-to-set-up-mysql-workbench-for-a-mamp-server/comment-page-1/#comment-6539 (this is just basic instructions to setting up MySQL Workbench with MAMP so no need to look through if you are familiar with the set up steps)
It all goes okay until the step were I have to select the Configuration File as:
/Applications/MAMP/tmp/mysql/mysql.sock
This file does not appear to be in this location or anywhere else on my computer.
In the answer to this link: Database connection "Mysql" is missing and mysql.sock is missing, he says he managed to figure out that his mysql.sock file was actually hidden, however I have my Mac set to display hidden files and I can see all my other hidden files, but still no sign of this file. He said after finding it was hidden he went to his database configuration file and added the following:
'unix_socket' => '/Applications/MAMP/tmp/mysql/mysql.sock'
Does anyone know what file he is referring to when he says database configuration file? I have tried figuring it out using Google but no luck. I am new to MAMP and new to MySQL Workbench.
This problem with the mysql.sock file, seems to be a problem for a lot of people. If anyone has a better solution than adding the above command to the database configuration file or can shed some light on this problem I would love to hear it.
Thanks
I have not been able to figure out where the mysql.sock file is, Mike Lischke has left a comment saying the socket file is created dynamically when you open a connection, which could be the case, but I do not know much about MySQL and the files so I can not confirm if this is correct, however, I have found the solution to my problem.
The overall problem was that I could not connect MySQLWorkbench to my Local Server (MAMP) as I could not find the mysql.sock file. When I tried to connect I was getting an error message saying it could not find the mysql.sock file.
The solution to my problem was to instead of setting the 'Hostname' in the MySQLWorkbench set up window as 'localhost', which is suggested in the guide I followed, I instead set it to the IP '127.0.0.1'. I then set the 'Connection Method' to 'Standard (TCP/IP)' instead of 'Local Socket/Pipe'. I believe what this is doing is setting it up to connect through the IP rather than the Socket, meaning the mysql.sock file is no long necessary.
This is a very simple solution and in hindsight it makes sense and I probably should have known this from the start, however because I am new to MySQL I didn't. If anyone else is having a similar problem connecting, I hope this helps.

How can I get back my privilege to create a new database in MySQL?

I can not use MySQL. MySQL is on my local computer. Currently I added skip-grant-tables in My.ini so I can use MySQL. But I have no privilege to create a new database. My problem is tough, although I asked related questions on SO, but no answer can resolve my problem. I almost give up. So I lower my expectation. I am developing a website, so I need to create database, tables and operate tables. You don't have to consider security. Is there a simple solution that can give me privilege to create a new database? Maybe by adding some command in my.ini or something? You won't need to completely resolve my problem. Maybe after the development, I will upload the database and tables to another server(The current database server is my personal computer, windows XP) so I can uninstall and reinstall MySQL.
The root of problem is that I lack privileges.
I'm not sure if this will work for you, since you might need to have elevated privileges in the first place, but it's worth a shot.
There should be a database called mysql. Take a look in there, and you'll see a table called users. For each record, there's a heap of columns named Select_priv, Insert_priv, etc. For your user record, change each of these to "Y".
It sounds a bit like your installation went astray.
Maybe uninstall/resinstall is your best option, assuming that you've never been able to connect, so there is no data to consider.
Take your time on the installation, and have a look at MySQL Postinstallation Notes
you have 4 questions open about this specific problem. instead of opening duplicates, you should instead update just one of them with new information.
but the simple solution to your problem is to download the ZIP file of mysql for your mysql version from the mysql website and just copy the data\mysql folder in to your data file, then restart the service. this will give you a root user with a blank password that has full access.