Mysql error 0

mysql error 0

Restart the machine and try Instance Configuration Again · Uninstall all MySQL software and making sure that there was no service and reinstall. 2022-05-03T11:36:53.787528Z 1 [ERROR] [MY-011013] [Server] Failed to initialize DD Storage Engine. 2022-05-03T11:36:53.788000Z 0 [ERROR]. Returns the error text from the last MySQL function. Errors coming back from the MySQL database backend no longer issue warnings. Instead, use mysql_error().

Mysql error 0 - suggest

MySQL error code 0 in PHP? Cannot insert data into database with PHP [closed]

Firstly, for those of you getting the misconception about for a column name:

Sure, it's MySQL "keyword", but not a "reserved" word; more specifically, it is a function (see ref). Notice there is no next to the "function (keyword) name": therefore it's perfectly valid as a column name.


Ticks are only required if it is used in order to prevent it from being recognized as a "function", which it clearly is not in the OP's case. So, get your information and facts straight.

More specifically, if a table named as and without spaces between the table name and the column declaration:


which would throw a syntax error, since the table name is considered as being a function.

Therefore, the proper syntax would need to read as

(Edit:) To answer the present question; you're using in your connection, but querying with along with the missing db variables passed to your query and the quotes/semi-colon I've already outlined here.

That's if you want to get that code of yours going, but I highly discourage it. You're using a deprecated MySQL library and MD5 as you stated. All old technology that is no longer safe to be used, nor will it be supported in future PHP releases.

You're missing a semi-colon here and quotes.

That should read as

You should also remove this:

you're already trying to include a connection file.

Use this in your connection file: (modified, using connection variable connection parameter)

and pass the to your query as the 2nd parameter.

Add error reporting to the top of your file(s) right after your opening PHP tag for example then the rest of your code, to see if it yields anything.

Also add to .

If that still gives you a hard time, you will need to escape your data.


and do the same for the others.

Use a safer method: (originally posted answer)

May as well just do a total rewrite and using with prepared statements.

Fill in the credentials for your own.

Sidenote: You may have to replace the last for an for the that's IF that column is an .

I noticed you may be storing passwords in plain text. If this is the case, it is highly discouraged.

I recommend you use CRYPT_BLOWFISH or PHP 5.5's function. For PHP < 5.5 use the .

You can also use this PDO example pulled from one of ircmaxell's answers:

Just use a library. Seriously. They exist for a reason.

Don't do it yourself. If you're creating your own salt, YOU'RE DOING IT WRONG. You should be using a library that handles that for you.

And on login:

User Comments

when using a different data directory e.g. d:/mysql/data I initially had problems.

I checked everything suggested on this site and everywhere else. Eventually I found the problem was linked to the permissions on the local machine. I had to change the user and password for the service to mine instead of the system for it to work.

I also had problems when installing 4.0.20 as a service under Windows 2000 Professional SP4. When I started 'mysqld-opt' from the command-line (leaving its console window open until I was done), it ran fine. But when I used 'mysqld-opt --install' to install and run MySQL as a service, it would not start correctly; about 10 seconds after starting the service, it would crash with a memory read error ("The instruction at 0x77------ referenced memory at 0x000000--, etc").

Although the SYSTEM user account has full privileges to the MySQL install directory and all subdirectories, I found that by changing the MySQL service to run as my 'administrator' account instead of 'local system', the service ran fine. I still do not know why it crashed when running as SYSTEM.

We changed the service to admin, and now we have a data folder that has grown from 3megs to 34 gigs. The files are all #sql-...frm #sql-...MYD #sql-...MYI, Users might want to beware

To run MySQL (4.0.20a) as a service on Win XP pro (SP2) using normal user privileges:

-Create a new user (e.g. MySQLservice)
-In Services, open the [Log on] tab of the MySQL properties and set Logon user to MySQLservice.
-If not automatically done so, using Local Security Policy or Group Policy console assign MySQLservice the right to Log on as a Service
-Make sure MySQLservice has appropriate NTFS settings for its Data dir
-In my case, it was also necessary to assign MySQLservice user the NTFS create files/write data privilege for C:\ (using "apply to this folder only" option). MySQL seems to create two zero byte temporary files at that location once it is up and running.

I have just upgraded form 3.23 to 4.1 - liked the new MSI GUI ,very nice - had a problem when I copied the old users across tho - I could only connect (localhost only) with root -

After setting the old_passwords variable to YES in my.ini it was all ok ....



We have version 4.1.13 on Windows XP SP2, but still received the message that the service could not be started: mysql error:0.

The upgrade procedure describes to remove the service manually before starting the installation if you have MySQL version 4.1.5 or below, but I suggest you always remove de service manually.

I was having a problem trying to start the mysqld-nt server (version 5.0.15) on win2k pro. The error log kept saying: Can't open privilege tables, table '' doesn't exist.

After reading all the tips regarding a) moving the data files, and b) creating a dedicated user (MySQLservice) to log on to the MySQL service (which I did with no results), I found my problem was not renaming the [mysqld] to [mysqld-nt] in my "my.ini" file. This solved it for me.

If your running the test commands and getting the "Access denied for user 'ODBC'@localhost' " error it is because you are trying to connect to the MySQL database server as an anonymous user who doesnt have access to the specified database. You must use the root user:

c:\mysql\bin\mysqlshow -u root `database_name`

I had a problem while upgrading MySQL from ver. 4.1.10a-nt to ver. 5.0.16 on a Win2K-system. Reason was, that the server did not read the my.ini-file even though it was present in the WINNT-directory, but instead it used the my.ini file from the mysql-directory.

I also had to rename the [mysqld] to [mysqld-nt] in my "my.ini" file, as well as delete the ib_logfile0 and ib_logfile1 in my data-area to get things running.

If you think you have succesfully installed MySQL 5.x, create 2 Databases, create 2+ tables in one database and try to copy both to the second database, if there is an error copying the first database but u can copy the second one alone, you must uninstall MySQL and re-install, the corrupted databases cannot be repaired even when imported into a fresh installation.

A tip when re-installing is to backup any error free databases, un-install all instances and stop & delete all services, un-install MySQL completely, move your old databases to a temporary folder and delete all previous traces, including subdirectories and any remainng databases. Now you can do a clean install, this will minimize on any issues during installation, including the annoying "cannot start service" err msg.

I personally install to a directory path that contains no spaces, if your running an Apache server and PHP this is more critical since sometimes spaces can cause issues. I still use only up to 8 standard characters per sub-directory (just for backwards compatability with older (much older) systems).

Hope this helps

If you are just trying to run the service on your local machine (XP pro - for me) make sure you download the full installation package NOT just the windows essentials. I was trying to get this to work for a long time, following everyone else's suggestions until I finally uninstalled and deleted everything and tried with the full ~35mb file. Make sure you stop the old service too.

(This was solved thanks to the tip above about checking "console messages" but I didn't see the exact error message covered anywhere so I thought I'd put it here so it'd be searchable.)

After upgrading to 5.1 in Windows this mystifying error...

ERROR 1017 (HY000): Can't find file: 't' (errno: 2)

(about a table 't' that should be there) ...turned out to have the same cause as this other SEEMINGLY unrelated error message from the console (mysqld --console):

InnoDB: Error: log file .\ib_logfile0 is of different size 0 10485760 bytes
InnoDB: than specified in the .cnf file 0 5242880 bytes!

And the solution to both (for me) was a line in my.ini:



Posted by Normann Aa. Nielsen on November 23 2005 12:54pm [Delete] [Edit]

I had a problem while upgrading MySQL from ver. 4.1.10a-nt to ver. 5.0.16 on a Win2K-system. Reason was, that the server did not read the my.ini-file even though it was present in the WINNT-directory, but instead it used the my.ini file from the mysql-directory.

I also had to rename the [mysqld] to [mysqld-nt] in my "my.ini" file, as well as delete the ib_logfile0 and ib_logfile1 in my data-area to get things running.

I installed from the, and ran into problems where the daemon would not run as a windows service, but would run fine under my user account. It first complained about not being able to find or read the ./ibdata1

I then deleted the directory, and re-extracted the zip file. I did not attempt to start it as my user, but immediately attempted to start it as a service. This got farther, but it complained about not being able to find or open the ./mysql/host.frm file. I noticed that the ibdata1 file was now owned by ????????? with a group of SYSTEM. This gave me the solution, I changed the group ownership of the mysql directory and all of its contents to SYSTEM, and everything seems to work fine now.

Using Win 7, the path C:\ProgramData is hidden by default. Change folder options to show hidden files and folders to see this directory.
(organize -> folder and search options -> show hidden folders)

Add your own comment.


(PHP 4, PHP 5)

mysql_errno — Returns the numerical value of the error message from previous MySQL operation


This extension was deprecated in PHP 5.5.0, and it was removed in PHP 7.0.0. Instead, the MySQLi or PDO_MySQL extension should be used. See also MySQL: choosing an API guide. Alternatives to this function include:


mysql_errno(resource = NULL): int

Errors coming back from the MySQL database backend no longer issue warnings. Instead, use mysql_errno() to retrieve the error code. Note that this function only returns the error code from the most recently executed MySQL function (not including mysql_error() and mysql_errno()), so if you want to use it, make sure you check the value before calling another MySQL function.


The MySQL connection. If the link identifier is not specified, the last link opened by mysql_connect() is assumed. If no such link is found, it will try to create one as if mysql_connect() had been called with no arguments. If no connection is found or established, an level error is generated.

Return Values

Returns the error number from the last MySQL function, or (zero) if no error occurred.


Example #1 mysql_errno() example

The above example will output something similar to:

1049: Unknown database 'nonexistentdb' 1146: Table 'kossu.nonexistenttable' doesn't exist

add a note

User Contributed Notes 3 notes

apoio at cyberspace dot org

22 years ago

15 years ago

simon at paarlberg dot dk

16 years ago

To Top


We are working on a larger site and box and we have run into an issue converting the wp_usermeta to the optimized form. All the other tables have converted correctly. This table has 1,097,079 rows, approximately, but this is way smaller than the wp_postmeta (4,349,147 rows, approximately) which worked.

We are working in a staging environment, so if you would like to see anything, please just ask.

Index WP MySQL For Speed 1.4.4
Versions Plugin:1.4.4 MySQL:8.0.27-18 WordPress:5.9.3 WordPress database:51917 php:7.4.29
Fatal error: Uncaught ImfsException: [0]: MySQL server has gone away in ALTER TABLE wp_usermeta ADD UNIQUE KEY umeta_id (umeta_id), DROP PRIMARY KEY, ADD PRIMARY KEY (user_id, meta_key, umeta_id), DROP KEY meta_key, ADD KEY meta_key (meta_key, meta_value(32), user_id, umeta_id), ADD KEY meta_value (meta_value(32), umeta_id), DROP KEY user_id/**imfs-query-tag*986555825*/

thrown in /var/www/ on line 375
Error: There has been a critical error on this website.Learn more about troubleshooting WordPress. There has been a critical error on this website.

Thank you,


MariaDB Error Codes

MariaDB shares error codes with MySQL, as well as adding a number of new error codes specific to MariaDB.

An example of an error code is as follows:

SELECT * FROM x; ERROR 1046 (3D000): No database selected

There are three pieces of information returned in an error:

  • A numeric error code, in this case . Error codes from 1900 and up are specific to MariaDB, while error codes from 1000 to 1800 are shared by MySQL and MariaDB.
  • An SQLSTATE value, consisting of five characters, in this case . These codes are standard to ODBC and ANSI SQL. When MariaDB cannot allocate a standard SQLSTATE code, a generic , or general error, is used.
  • A string describing the error, in this case .

New error codes are being continually being added as new features are added. For a definitive list, see the file , as well as in the build directory, generated by the tool. Also, the perror tool can be used to get the error message which is associated with a given error code.

Shared MariaDB/MySQL error codes

MariaDB-specific error codes


Question 1: [MySQL]cannot create Windows Service for MySQL. Error :0
Error :0 Error: Cannot create Windows Service Formysql.error :0 error.
Most of the errors were caused by reinstalling mysql or upgrading myDQL using the MySQLConfiguration Wizard.
You can use the Windows SC program to remove the mysql service.
C:> sc delete mysql
[SC] DeleteService SUCCESS
If you reuse the MySQL Configuration Wizard, you will not have this error.
If that still doesn’t work, just restart the computer
I did so, but a new mistake came up:
Question 2: [MySQL] Could not start the service MySQL
When installing mysql 5.1.33, there was an error in the third item of the Execute Configuration wizard in the Server Instance Configuration wizard to Start Service. The error was suggested to be “Could not Start the Service mysql” (this situation was usually caused by the dirty uninstall of mysql after installing mysql. Uninstall, restart, and reinstall. Take a look at the service. If it fails to uninstall, you can use mysqld-nt-remove).
The specific method is as follows :
check whether there is mysql in the service, if there is, stop the service;
run the add and remove program in the control panel and unload mysql;
after unloading, open the registry, view HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services under the key, if there are related mysql key values (mysql, mysqladmin) then delete it;
restart, remove the mysql installation residual directory (check the service, at this time there is no mysql in the service);
reinstall mysql. Do not run the Server Instance Configuration wizard after installation. Run the wizard from the start menu after restarting.
PS: A method worthy of reference

Question 3: What if the control panel does not add or remove programs?
, click “Start → Run”, enter “Appwiz.cpl” enter, so that the corresponding module can be started.
. Find the file path “C :\ Windows \ System32 \ AppWiz. CPL” from the installation disk. And then copy and paste
. Re-register
Click “Start → Run” to enter:
regsvr32 mshtml.dll
regsvr32 shdocvw.dll -i
regsvr32 shell32.dll -i
Question 4: How do I use the registry to delete an uninstaller
First, click Start – run – type Regedit – enter the registry – then click HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Uninstall- where you can see which Software you’ve installed before!
then click on the software you want to uninstall — you can see the “UninstallString” subkey next to it — double click on the subkey and the edit string dialog will pop up — copy the key inside
and then go back to the desktop — click start — run — paste the key inside — enter ~!
so that you can delete in the add and delete not in the program ~! Of course, if there is no program in it that you want to uninstall ~! So those programs are not registered in the registry, which means you can delete them directly.

Read More:

This entry was posted in How to Fix and tagged Exception class, Java web class on by Robins.

Troubleshoot errors commonly encountered during or post migration to Azure Database for MySQL

  • Article
  • 5 minutes to read

APPLIES TO: Azure Database for MySQL - Single Server Azure Database for MySQL - Flexible Server

Azure Database for MySQL is a fully managed service powered by the community version of MySQL. The MySQL experience in a managed service environment may differ from running MySQL in your own environment. In this article, you'll see some of the common errors users may encounter while migrating to or developing on Azure Database for MySQL for the first time.

Common Connection Errors

ERROR 1184 (08S01): Aborted connection 22 to db: 'db-name' user: 'user' host: 'hostIP' (init_connect command failed)

The above error occurs after successful sign-in but before executing any command when session is established. The above message indicates you have set an incorrect value of server parameter, which is causing the session initialization to fail.

There are some server parameters like that aren't supported at the session level, and so trying to change the values of these parameters using can result in Error 1184 while connecting to the MySQL server as shown below:

mysql> show databases; ERROR 2006 (HY000): MySQL server has gone away No connection. Trying to reconnect... Connection id: 64897 Current database: *** NONE *** ERROR 1184 (08S01): Aborted connection 22 to db: 'db-name' user: 'user' host: 'hostIP' (init_connect command failed)

Resolution: Reset value in Server parameters tab in Azure portal and set only the supported server parameters using init_connect parameter.

Errors due to lack of SUPER privilege and DBA role

The SUPER privilege and DBA role aren't supported on the service. As a result, you may encounter some common errors listed below:

ERROR 1419: You do not have the SUPER privilege and binary logging is enabled (you might want to use the less safe log_bin_trust_function_creators variable)

The above error may occur while creating a function, trigger as below or importing a schema. The DDL statements like CREATE FUNCTION or CREATE TRIGGER are written to the binary log, so the secondary replica can execute them. The replica SQL thread has full privileges, which can be exploited to elevate privileges. To guard against this danger for servers that have binary logging enabled, the MySQL engine requires that stored function creators have the SUPER privilege, in addition to the usual CREATE ROUTINE privilege.

Resolution: To resolve the error, set to 1 from server parameters blade in portal, execute the DDL statements or import the schema to create the desired objects. You can continue to maintain to 1 for your server to avoid the error in future. Our recommendation is to set as the security risk highlighted in MySQL community documentation is minimal in Azure Database for MySQL as bin log isn't exposed to any threats.

ERROR 1227 (42000) at line 101: Access denied; you need (at least one of) the SUPER privilege(s) for this operation. Operation failed with exitcode 1

The above error may occur while importing a dump file or creating procedure that contains definers.

Resolution: To resolve this error, the admin user can grant privileges to create or execute procedures by running GRANT command as in the following examples:

Alternately, you can replace the definers with the name of the admin user that is running the import process as shown below.

ERROR 1227 (42000) at line 295: Access denied; you need (at least one of) the SUPER or SET_USER_ID privilege(s) for this operation

The above error may occur while executing CREATE VIEW with DEFINER statements as part of importing a dump file or running a script. Azure Database for MySQL doesn't allow SUPER privileges or the SET_USER_ID privilege to any user.


  • Use the definer user to execute CREATE VIEW if possible. It's likely that there are many views with different definers having different permissions, so this may not be feasible. OR
  • Edit the dump file or CREATE VIEW script and remove the DEFINER= statement from the dump file. OR
  • Edit the dump file or CREATE VIEW script and replace the definer values with user with admin permissions who is performing the import or execute the script file.


Use sed or perl to modify a dump file or SQL script to replace the DEFINER= statement

ERROR 1227 (42000) at line 18: Access denied; you need (at least one of) the SUPER privilege(s) for this operation

The above error may occur if you're using trying to import the dump file from MySQL server with GTID enabled to the target Azure Database for MySQL server. Mysqldump adds SET @@SESSION.sql_log_bin=0 statement to a dump file from a server where GTIDs are in use, which disables binary logging while the dump file is being reloaded.

Resolution: To resolve this error while importing, remove or comment out the below lines in your mysqldump file and run import again to ensure it's successful.


Common connection errors for server admin sign-in

When an Azure Database for MySQL server is created, a server admin sign-in is provided by the end user during the server creation. The server admin sign-in allows you to create new databases, add new users and grant permissions. If the server admin sign-in is deleted, its permissions are revoked or its password is changed, you may start to see connections errors in your application while connections. Following are some of the common errors

ERROR 1045 (28000): Access denied for user 'username'@'IP address' (using password: YES)

The above error occurs if:

  • The username doesn't exist.
  • The user username was deleted.
  • its password is changed or reset.


  • Validate if "username" exists as a valid user in the server or is accidentally deleted. You can execute the following query by logging into the Azure Database for MySQL user:

  • If you can't sign in to the MySQL to execute the above query itself, we recommend you to reset the admin password using Azure portal. The reset password option from Azure portal will help recreate the user, reset the password, and restore the admin permissions, which will allow you to sign in using the server admin and perform further operations.

Next steps

If you didn't find the answer you're looking for, consider the following options:

mysql error 0


Leave a Comment