Mysql Error Code 1042
Contents |
Start here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn mysql error 1042 c# more about hiring developers or posting ads with us Server Fault Questions Tags Users Badges mysql cannot get hostname for your address Unanswered Ask Question _ Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:
Error 1042 (hy000): Can't Get Hostname For Your Address
Sign up Here's how it works: Anybody can ask a question Anybody can answer The best answers are voted up and rise to the top Error connecting remote MySQL server [ERROR 1042 (HY000): Can't get hostname for your
Mysql Skip-name-resolve
address] up vote 2 down vote favorite 3 Have MySQL 5.5 Server setup on a windows machine. I am able to connect to the server from console / app running on the same machine but not from a remote machine. While connecting using the command mysql -h xx.xx.xx.xx --port=3306 -u root -p I get error as: ERROR 1042 (HY000): Can't get hostname for your address Have tried putting entry of client ip in server's etc\hosts file as unable to connect to any of the specified mysql hosts.
Community Podcasts MySQL.com Downloads Documentation Section Menu: MySQL Forums :: Connector/NET and C#, Mono, .Net :: Error 1042 - Unable to connect to any of the specified MySQL hosts New Topic Advanced Search Error 1042 - Unable to connect to any of the specified MySQL hosts Posted by: Gustavo Martín () Date: November 23, 2011 12:52PM Hi you all. I'm having a problem with my own app developed in VB.net 2010. First of all I'm going to give you my configuration to make you an idea of what I'm talking about. OS: WindowsXP Pro SP3 http://serverfault.com/questions/174242/error-connecting-remote-mysql-server-error-1042-hy000-cant-get-hostname-for MySQL Server: 5.5 Connector .NET: 6.4.4 First of all I configured file my.ini to accept remote connetions by adding the line bind-address=0.0.0.0 and I erased line that says skip-networking. When I run my app localy, I login as root user and everything works fine. The problem came when I tried to remotely access to MySQL. I login as root user and everything works fine until http://forums.mysql.com/read.php?38,502542,502542 the vb code executes the following: DbGCATPacientes_PersonalespacientesTableAdapter.Fill(DbGCATPacientes_Personales.pacientes) This line raises the Error 1042 - Unable to connect to any of the specified MySQL hosts So I access the server via command line. I login without any problem and type in show proccesslist; to see the connections. There is a connection for the app. Grants for user root are all for *.* and for the database I created in mysql. And I also have a user 'root'@'%' with all privileges to ensure that remote hosts can access the database. Where can be the problem? I don't understand, if I can login mysql without any problem, why or what raises this error and just for remote connection? Thanks and waitting for an answer, Gustavo Navigate:Previous Message•Next Message Options:Reply•Quote Subject Written By Posted Error 1042 - Unable to connect to any of the specified MySQL hosts Gustavo Martín 11/23/2011 12:52PM Re: Error 1042 - Unable to connect to any of the specified MySQL hosts Jim Buckley-Barrett 12/14/2011 05:19AM Sorry, you can't reply to this topic. It has been closed. powered by phorum Content reproduced on this site is the property of the respective copy
communities company blog Stack Exchange Inbox Reputation and Badges sign up log in tour help Tour Start here for a quick overview of the site Help Center Detailed answers to any questions you might have http://askubuntu.com/questions/657606/why-do-i-keep-getting-mysql-error-1042 Meta Discuss the workings and policies of this site About Us http://www.fromdual.com/mysql-error-codes-and-messages-1000-1049 Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Ask Ubuntu Questions Tags Users Badges Unanswered Ask Question _ Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes mysql error a minute: Sign up Here's how it works: Anybody can ask a question Anybody can answer The best answers are voted up and rise to the top Why do I keep getting mysql error 1042? up vote 0 down vote favorite I'm creating an ASP.NET web api on a linux VPS, using Apache and mod_mono. I have everything get hostname for set up and have successfully demonstrated that the web api routes are working. My newest local changes add integration with a mysql database. On my development machine, this works perfectly. However, whenever I upload the published API, the connection to the database fails. I did some digging and realized that the exception being thrown reports error 1042 - Can't get hostname for your address. Here's my connection string: SERVER={0};DATABASE={1};UID={2};PASSWORD={3}; (server is localhost, and other values are filled in appropriately). What am I doing wrong? How can I get it to connect to mysql? I have no problems connecting from the same account I'm trying to use when I'm ssh'ed in on my admin account... EDIT: I've tried putting skip-name-resolve in /var/mysql/my.cnf, but it didn't do anything. I've also tried flushing hosts in mysql. server apache2 mysql share|improve this question asked Aug 7 '15 at 8:46 Brian Gradin 1208 Have you tried replacing "localhost" with the actual IP address of the server? That would skip the name resolving step. &
hashchk Error: 1001 SQLSTATE: HY000 (ER_NISAMCHK) Message: isamchk Error: 1002 SQLSTATE: HY000 (ER_NO) Message: NO Error: 1003 SQLSTATE: HY000 (ER_YES) Message: YES Error: 1004 SQLSTATE: HY000 (ER_CANT_CREATE_FILE) Message: Can't create file '%s' (errno: %d) Error: 1005 SQLSTATE: HY000 (ER_CANT_CREATE_TABLE) Message: Can't create table '%s' (errno: %d) Error: 1006 SQLSTATE: HY000 (ER_CANT_CREATE_DB) Message: Can't create database '%s' (errno: %d) How does the MySQL error message look like? mysql> CREATE DATABASE test; ERROR 1006 (HY000): Can't create database 'test' (errno: 13) What does the MySQL error message mean? The MySQL Server (mysqld process) can, for whatever reason, NOT create a schema/database. Additional information you can get as follows: shell> perror 13 OS error code 13: Permission denied When does this MySQL error message happen? This MySQL error usually happens when the MySQL data directory (datadir) does not belong to the user under which the mysqld process runs. For example the data directory belongs to the user root and the mysqld process runs as user mysql. How to fix this MySQL error? If the MySQL data directory does not belong to the user the mysqld process is running under, you can fix this for example as follows: shell> sudo su - shell> cd /var/lib shell> chown -R mysql:mysql mysql Alternatively you can start the mysqld process as follows: shell> bin/mysqld_safe --user=mysql or set the user accordingly in your my.cnf file. # my.cnf [mysqld] user = mysql Error: 1007 SQLSTATE: HY000 (ER_DB_CREATE_EXISTS) Message: Can't create database '%s'; database exists How does the MySQL error message look like? mysql> CREATE SCHEMA test; ERROR 1007 (HY000): Can't create database 'test'; database exists What does the MySQL error message mean? MySQL (the mysqld process) can, for whatever reason NOT create a schema/database. When does this MySQL error message happen? This MySQL error apears, as the error message states, when the database already exists. How to fix this MySQL error? You have 2 possiblities: Choose an other name for your new database / schema. Drop your old database / schema. Rename your old database / schema (we can provide you more information, how to do this). Error: 1008 SQLSTATE: HY000 (ER_DB_DROP_EXISTS) Message: Can't drop database '%s'; database doesn't exist Error: 1009 SQLSTATE: HY000 (ER_DB_DROP_DELETE) Message: Error dropping database (can't delete '%s', errno: %d) Error: 1010 SQLSTATE: HY000 (ER_DB_DROP_RMDIR) Message: Error dropping database (can't rmdir '%s', errno: %d) Error: 1011 SQLSTATE: HY000 (ER_CANT_DELETE_FILE) Message: Error on