The version of MySQL is 8.0.16. This is installed on an EC2 Linux and is a fresh install. I have run the mysql_secure_installation command after installation and was able to change the root password successfully and was also able to add a second user with basic privileges.   To test the connection I made a simple script:  $link = mysqli_connect($dbhost, $dbuser, $dbpass);           if (mysqli_connect_error() ){         echo "Debugging errno: " . mysqli_connect_errno() . PHP_EOL;     }else{         echo "Connection successful";     }   I have double checked the values of the variables and they are all correct. When I try to visit the URL it says:     Debugging errno: 2054   How to resolve this?
122983
I use PHP 5.4.3 and I want to connect to a MySQL database (DB for brevity) remotely (the PHP script resides on a different server than the DB) with normal object-oriented programming (OOP) way:  $mysqli = new mysqli(DB_HOST, DB_USER, DB_PASS, DB_NAME);   and I get the error:      Warning: mysqli::mysqli(): The server requested authentication method unknown to the client [mysql_old_password]   Connect Error (2054) The server requested authentication method unknown to the client   I found  and  but they don't seem to help. I used PHP 5.2.9 and everything worked OK, but downgrading the PHP version is not a solution for me.   I also have to mention that I don't have full access to DB's settings cause the client doesn't give me that kind of access. I told him to ask Hostgator for a newer password format support, but they answered that they cannot do anything which was not what I was expecting. I did a new effort from another remote server and I get now this:     Connect Error (1045) Access denied for user 'user'@'host' (using password: YES)   by using PHP 5.3.9. It looks like the DB doesn't "let me in" because of the remote server's PHP script, but with Oracle's Workbench everything works fine.  Thanks for your time.
58582
I have a debian server with docker 1.6.0 on it with a running official mysql container ().  I use a fairly basic firewall configuration in which all ports are closed except SSH, HTTP and NTP ().  When I try to connect to my mysql database:  mysql -u root -h 172.17.0.3 -p   I get the following error message:  ERROR 2003 (HY000): Can't connect to MySQL server on '172.17.0.3' (110)   Port 3306 is filtered on it :  nmap -p 3306 172.17.0.3  PORT     STATE    SERVICE 3306/tcp filtered mysql   ... and when I open port 3306 on the host i can access to the mysql server.  How to access the mysql server container without opening port 3306 of the host machine ?  Further information than can help:  The ansible task to launch the container :  - name: Mysql container   docker:     name: mysql     image: mysql:5.7     state: started     volumes:     - /var/container_data/mysql:/var/lib/mysql     ports:     - "127.0.0.1:3306:3306"     env:         MYSQL_ROOT_PASSWORD: my-root-password   docker inspect mysql -> pastebin.com/raw.php?i=uhXEhuXJ  iptables -L -> pastebin.com/raw.php?i=18fkgktF  ifconfig -> pastebin.com/raw.php?i=YJs2JnQx  If you need more information don't hesitate to ask me.  Best regards
106111
I have already uploaded some files in the free web host I chose and created a database there using phpMyAdmin v2.11.4  Also, I have Googled first this question before posting this here but I don't understand some rules and I need a clarification.  The exact error I get from viewing my uploaded file(index.php) is this:  Warning: mysqli_connect() [function.mysqli-connect]: (HY000/1130): Host '31.170.160.98' is not allowed to connect to this MySQL server in /home/a6400350/public_html/subdomains/index.php on line 7   Domain name of free web host I'm using is   And my php code for connecting to host is:  &lt;?php  $host = "sql10.000webhost.com"; //or "31.170.160.98" $username = "a6400350xxxxxx"; $password = "••••••••";  $con = mysqli_connect($host, $username, $password);  ?&gt;    I also check if the server is down  or it's just me There was also no previlege section in phpMyAdmin page as other suggest   Don't I have any permission to connect programmatically to this host as I am just a free user?  Edit     I'm also thinking of uploading the whole XAMPP in the server so I   could do the things I'm imagining.   Edit 2     Also one more thing, I imported the database by means of .sql file   locally through that server, maybe this has something to do about it?
99934
I have need to connect to mySql server 5.5 and create database using command line. Ideally it would be using a UI utility but I don't have it.  Here is an issue:  alex@ubuntu:~$ sudo mysql -u root ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)   However I definitely set password while I was installing MySql server.  What should I do to solve it?
72208
I am pretty new to linux and LAMP setup. I want to setup a LAMP environment with AP on one linux server and M on a different linux server. I have a hard time finding a relevant document with such a configuration.  I have done the following steps so far:  server1:  yum install -y httpd /sbin/service httpd restart yum install -y php php-mysql sed -i "s/Listen 80/#Listen 80/g" /etc/httpd/conf/httpd.conf yum install -y mod_ssl openssl /sbin/service httpd restart service iptables stop   I changed the ServerName in /etc/httpd/conf/httpd.conf from  #ServerName www.example.com:80   to  ServerName 172.32.35.14 (ip address of server1) /sbin/service httpd restart   server2:  yum install -y mysql-libs yum install -y mysql yum install -y perl-DBI yum install -y perl-DBD-MySQL yum install -y mysql-server /sbin/chkconfig mysqld on /sbin/service mysqld start mysql -u root  -e "CREATE USER 'mysqluser' IDENTIFIED by 'password'"  mysql -u root  -e "CREATE USER 'mysqluser'@'localhost' IDENTIFIED by 'password'" mysql -u root  -e "GRANT ALL PRIVILEGES ON *.* TO 'mysqluser'@'localhost' WITH GRANT OPTION" mysql -u root  -e "GRANT ALL PRIVILEGES ON *.* TO 'mysqluser'@'%' WITH GRANT OPTION" mysql -u mysqluser -p password -e "CREATE DATABASE mysqldb"  mysql -u mysqluser -p password mysqldb &lt; /tmp/mysqlinstaller/world.sql service iptables stop   Then I had these post configuration steps:  On server 2, where my mysql is installed, I did the following:  bind-address = 172.32.35.14 (ip of server 1 where apache/php are installed) service mysql restart   But I am not able to establish a connection. Can you point out what I am missing and guide me please.
35457
I used apt install mysql-server to install MySQL on Ubuntu 16.04 but during the installation, it did not ask for root password.  After installation I got ERROR 1045 when I tried to login as root and mysql_secure_installation threw the same error. I purged and autoremoved then reinstalled but it does not work.  How could i fix this? Can I set the root password if I didn't set it during installation?  This is my installation log:   The following additional packages will be installed:   libaio1 mysql-client-5.7 mysql-client-core-5.7 mysql-server-5.7   mysql-server-core-5.7 Suggested packages:   mailx tinyca The following NEW packages will be installed:   libaio1 mysql-client-5.7 mysql-client-core-5.7 mysql-server mysql-server-5.7   mysql-server-core-5.7 0 upgraded, 6 newly installed, 0 to remove and 0 not upgraded. Need to get 0 B/17,9 MB of archives. After this operation, 160 MB of additional disk space will be used. Do you want to continue? [Y/n] y Preconfiguring packages ... Selecting previously unselected package libaio1:amd64. (Reading database ... 227144 files and directories currently installed.) Preparing to unpack .../libaio1_0.3.110-2_amd64.deb ... Unpacking libaio1:amd64 (0.3.110-2) ... Selecting previously unselected package mysql-client-core-5.7. Preparing to unpack .../mysql-client-core-5.7_5.7.12-0ubuntu1_amd64.deb ... Unpacking mysql-client-core-5.7 (5.7.12-0ubuntu1) ... Selecting previously unselected package mysql-client-5.7. Preparing to unpack .../mysql-client-5.7_5.7.12-0ubuntu1_amd64.deb ... Unpacking mysql-client-5.7 (5.7.12-0ubuntu1) ... Selecting previously unselected package mysql-server-core-5.7. Preparing to unpack .../mysql-server-core-5.7_5.7.12-0ubuntu1_amd64.deb ... Unpacking mysql-server-core-5.7 (5.7.12-0ubuntu1) ... Selecting previously unselected package mysql-server-5.7. Preparing to unpack .../mysql-server-5.7_5.7.12-0ubuntu1_amd64.deb ... Unpacking mysql-server-5.7 (5.7.12-0ubuntu1) ... Selecting previously unselected package mysql-server. Preparing to unpack .../mysql-server_5.7.12-0ubuntu1_all.deb ... Unpacking mysql-server (5.7.12-0ubuntu1) ... Processing triggers for libc-bin (2.23-0ubuntu3) ... Processing triggers for man-db (2.7.5-1) ... Processing triggers for systemd (229-4ubuntu4) ... Processing triggers for ureadahead (0.100.0-19) ... Setting up libaio1:amd64 (0.3.110-2) ... Setting up mysql-client-core-5.7 (5.7.12-0ubuntu1) ... Setting up mysql-client-5.7 (5.7.12-0ubuntu1) ... Setting up mysql-server-core-5.7 (5.7.12-0ubuntu1) ... Setting up mysql-server-5.7 (5.7.12-0ubuntu1) ... update-alternatives: using /etc/mysql/mysql.cnf to provide /etc/mysql/my.cnf (my.cnf) in auto mode Checking if update is needed. This installation of MySQL is already upgraded to 5.7.12, use --force if you still need to run mysql_upgrade Setting up mysql-server (5.7.12-0ubuntu1) ... Processing triggers for libc-bin (2.23-0ubuntu3) ...
22164
I just can't login to PhpMyAdmin anymore, it says bad logins. PHP works perfectly. Please help. Thank you.  2002 Cannot log in to the MySQL server Language Log in Username: Password:  Connection for controluser as defined in your configuration failed.
96562
I tried restarting the Mysql server but its not working for me. I am sure the server is running and the permissions on the folder /var/lib/mysql/ are correct (777).  When i tried to open the file mysql.sock, its giving me an error saying the file may be corrupt.  Please help me to log on to the mysql server.
73
If user input is inserted without modification into an SQL query, then the application becomes vulnerable to , like in the following example:  $unsafe_variable = $_POST['user_input'];   mysql_query("INSERT INTO `table` (`column`) VALUES ('$unsafe_variable')");   That's because the user can input something like value'); DROP TABLE table;--, and the query becomes:  INSERT INTO `table` (`column`) VALUES('value'); DROP TABLE table;--')   What can be done to prevent this from happening?
98560
I have setup a mysql server on unbuntu. The server hosts websites for my various clients. Hence, I want all of them(and any new clients) to have remote access to the mysql server. How do I configure mysql for the same?  I know about the GRANT ALL PRIVILEGES command, but that would require me to individually grant remote access to all the users.
37286
I have followed this  to install MySQL but after successfully installed MySQL, I could not access database.     ERROR 1698 (28000): Access denied for user 'root'@'localhost'
22321
I've set up mysql and phpmyadmin and chose not to set a password when installing hoping that once set up i could login with root and no password but i get the following error from phpmyadmin:  Login without a password is forbidden by configuration (see AllowNoPassword)   I have previously moved the phpmyadmin folder to /var/www/   I have tried changing the following line  $cfg['Servers'][$i]['AllowNoPassword'] = false;   to  $cfg['Servers'][$i]['AllowNoPassword'] = true;   but still had no success, so i am wondering is there a way i can change the root passwords for both so i can access phpmyadmin and create databases.
64915
I'm trying to install phpMyAdmin using sudo apt-get install phpmyadmin but encountering this error  Err http://gb.archive.ubuntu.com/ubuntu/ precise-updates/main mysql-common all 5.5.34-0ubuntu0.12.04.1   404  Not Found [IP: 194.169.254.10 80] Err http://security.ubuntu.com/ubuntu/ precise-security/main mysql-common all 5.5.34-0ubuntu0.12.04.1   404  Not Found [IP: 91.189.91.15 80] Err http://security.ubuntu.com/ubuntu/ precise-security/main libmysqlclient18 i386 5.5.34-0ubuntu0.12.04.1   404  Not Found [IP: 91.189.91.15 80] Err http://security.ubuntu.com/ubuntu/ precise-security/main mysql-client-core-5.5 i386 5.5.34-0ubuntu0.12.04.1   404  Not Found [IP: 91.189.91.15 80] Err http://security.ubuntu.com/ubuntu/ precise-security/main mysql-client-5.5 i386 5.5.34-0ubuntu0.12.04.1   404  Not Found [IP: 91.189.91.15 80] Err http://security.ubuntu.com/ubuntu/ precise-security/main mysql-client all 5.5.34-0ubuntu0.12.04.1   404  Not Found [IP: 91.189.91.15 80] Failed to fetch http://security.ubuntu.com/ubuntu/pool/main/m/mysql-5.5/mysql-common_5.5.34-0ubuntu0.12.04.1_all.deb  404  Not Found [IP: 91.189.91.15 80] Failed to fetch http://security.ubuntu.com/ubuntu/pool/main/m/mysql-5.5/libmysqlclient18_5.5.34-0ubuntu0.12.04.1_i386.deb  404  Not Found [IP: 91.189.91.15 80] Failed to fetch http://security.ubuntu.com/ubuntu/pool/main/m/mysql-5.5/mysql-client-core-5.5_5.5.34-0ubuntu0.12.04.1_i386.deb  404  Not Found [IP: 91.189.91.15 80] Failed to fetch http://security.ubuntu.com/ubuntu/pool/main/m/mysql-5.5/mysql-client-5.5_5.5.34-0ubuntu0.12.04.1_i386.deb  404  Not Found [IP: 91.189.91.15 80] Failed to fetch http://security.ubuntu.com/ubuntu/pool/main/m/mysql-5.5/mysql-client_5.5.34-0ubuntu0.12.04.1_all.deb  404  Not Found [IP: 91.189.91.15 80] E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?   What could be the issue here? How do I solve it?
30010
Help!  I have a PHP (PHP 5.2.5) script on HOST1 trying to connect to an MySql database HOST2. Both hosts are in Shared Host environments controlled through CPanel.  HOST2 is set to allow remote database connections from HOST1.  The PHP connect I'm using is:-     $h2 = IPADDRESS;     $dbu = DBUSER;     $dbp = DBPASS;  $DBlink = mysql_connect($h2, $dbu, $dbp);   This always fails with:-  Access denied for user '&lt;dbusername&gt;'@'***SOMESTRING***' (using password: YES)   nb: SOMESTRING looks like it could be something to do with the shared host environment.  Any ideas???  BTW: I can make remote connections to HOST2 from my laptop using OpenOffice via ODBC, and SQLyog. The SQLyog and ODBC settings are exactly the same as the PHP script is trying to use.
85030
I'm having some trouble updating a row in a MySQL database. Here is the code I'm trying to run:  import MySQLdb  conn=MySQLdb.connect(host="localhost", user="root", passwd="pass", db="dbname") cursor=conn.cursor()  cursor.execute("UPDATE compinfo SET Co_num=4 WHERE ID=100") cursor.execute("SELECT Co_num FROM compinfo WHERE ID=100") results = cursor.fetchall()  for row in results:     print row[0]  print "Number of rows updated: %d" % cursor.rowcount  cursor.close() conn.close()   The output I get when I run this program is:     4Number of rows updated: 1   It seems like it's working but if I query the database from the MySQL command line interface (CLI) I find that it was not updated at all. However, if from the CLI I enter UPDATE compinfo SET Co_num=4 WHERE ID=100; the database is updated as expected.  What is my problem? I'm running Python 2.5.2 with MySQL 5.1.30 on a Windows box.
96046
I am having a few issues when people are trying to access a MySQL database and they are trying to update tables with the same information.  I have a webpage written using PHP. In this webpage is a query to check if certain data has been entered into the database. If the data hasn't, then i proceed to insert it. The trouble is that if two people try at the same time, the check might say the data has not been entered yet but when the insert takes place it has been by the other person.  What is the best way to handle this scenario? Can i lock the database to only process my queries first then anothers?
6089
I have installed MySQL workbench from Snap Store and MySQL server 8.0 using apt. The server is running fine and I can access MySQL shell from terminal. But I am having issues connecting the Workbench to the server. I'm getting          Cannot Connect to Database Server Your connection attempt failed for user 'root' to the MySQL server at localhost:3306:   An AppArmor policy prevents this sender from sending this message to this recipient; type=&quot;method_call&quot;, sender=&quot;:1.125&quot; (uid=1000 pid=7944 comm=&quot;/snap/mysql-workbench-community/5/usr/bin/mysql- wo&quot; label=&quot;snap.mysql-workbench-community.mysql-workbench- community (enforce)&quot;) interface=&quot;org.freedesktop.Secret.Service&quot; member=&quot;OpenSession” error name=&quot;(unset)&quot; requested_reply=&quot;0&quot; destination=&quot;:1.13&quot; (uid=1000 pid=2044 comm=&quot;/usr/bin/gnome- keyring-daemon --daemonize --login&quot; label=&quot;unconfined&quot;) Please: 1 Check that MySQL is running on address localhost 2 Check that MySQL is reachable on port 3306 (note: 3306 is the default, but this can be changed) 3 Check the user root has rights to connect to localhost from your address (MySQL rights define what clients can connect to the server and from which machines) 4 Make sure you are both providing a password if needed and using the correct password for localhost connecting from the host address you're connecting from  There no field for entering password. It shows two options store in keychain and clear.  On selecting store in keychain it prompts for a password, and I enter the password. But then it shows an error:  Could not store password: An AppArmor policy prevents this sender ...