Mysql database deactivated - Xampp v3.2.1, Windows 8 - mysql

Yes, I know this question has been asked and answered a dozen times but I have searched and tried all that was suggested and uninstalled and reinstalled like 4 times and still haven't gotten any closer to activating mysql database. It shouldn't be deactivated.
Please help me. I wanted to post pictures which would help in visualizing what is going on but I can't so I will try my best to explain.
xampp control panel: I have apache and mysql service modules ticked.
localhost/xampp status page shows mysql database : deactivated.
localhost/phpmyadmin shows exclamation marks on the databases and 'x' on the server connection collation.
for this question i did check mysql_error.log as suggested by best answer:
2014-08-27 11:18:44 28348 [Note] InnoDB: 5.6.20 started; log sequence number 1665244
2014-08-27 11:18:44 28348 [Note] Server hostname (bind-address): '*'; port: 3306
2014-08-27 11:18:44 28348 [Note] IPv6 is available.
2014-08-27 11:18:44 28348 [Note] - '::' resolves to '::';
2014-08-27 11:18:44 28348 [Note] Server socket created on IP: '::'.
2014-08-27 11:18:45 28348 [Note] Event Scheduler: Loaded 0 events
2014-08-27 11:18:45 28348 [Note] C:\xampp\mysql\bin\mysqld.exe: ready for connections.
Version: '5.6.20' socket: '' port: 3306 MySQL Community Server (GPL)
so port is 3306.
for the answer below the best answer i did run mysql_start.bat:
MySQL is trying to start
Please wait ...
MySQL is starting with mysql\bin\my.ini<console>
[Warning] Using unique option prefix key_buffer instead of key_buffer_size is
deprecated and will be removed in future release. Please use full name instead.
[Warning[ TIMESTAMP with implicit DEFAULT value is deprecated. Please use
--explicit_defaults_for_timestamp server option <see documentation for more details>
MySQL could not be started.
"MySQL could not be started"
for this question i did do the second bullet but it didnt work for me. mysql database status still remianed deactivated.
I wanted to try this blog's suggestions but I couldn't find winmysqladmin.exe
I'm sorry, it must be annoying having this question pop up all the time like spam but I really need help with this. Please and thank you!
EDIT
if i go to 127.0.0.1/phpmyadmin the exclamation marks and x is not there but 127.0.0.1/xampp/ status page still shows mysql database deactivated.
i tested ipv6: it is enabled but i don't have an address for it so i guess ipv4 is what im using. how do i bind it to ipv4 instead of ipv6? do i just disable ipv6?

Attempting to start MySQL service...
Problem detected!
Port 3306 in use by "I:\xampp\mysql\bin\mysqld.exe"!
MySQL WILL NOT start without the configured ports free!
You need to uninstall/disable/reconfigure the blocking application
or reconfigure MySQL and the Control Panel to listen on a different port
Attempting to start MySQL service...

Related

MySQL won't start on Bitnami EC2 instance

My EC2 instance ran out of space so followed directions to backup and restore to a larger volume. After I did that, I couldn't start up MySQL anymore.
When I try to start MySQL on my EC2 instance with Bitnami, it just hangs there. It looks like it's because I don't have a socket file at all where it should be /opt/bitnami/mysql/tmp/mysql.sock. Instead I just have a lock file there (/opt/bitnami/mysql/tmp/mysql.sock.lock).
One source I found said to recreate a symlink to another .sock file but I think because it's Bitnami it's in a different location and I'm not sure where that is.
Of course, it's possible that this sock file is just a red herring so I'm also digging into other possible causes. Has anyone else had this happen before? It seems like a problem that could be common but I haven't been able to find much about this aside from the vanilla Bitnami docs.
If you look at the MySQL script that Bitnami has (found at /opt/bitnami/mysql/scripts/ctl.sh) you can see that the MySQL log file is located at /opt/bitnami/mysql/data/mysqld.log on Bitnami instances. Look at the most recent logs, mine showed the following toward the end of the logs:
[Warning] Failed to set up SSL because of the following SSL library error: SSL context is not usable without certificate and private key
[Note] Server hostname (bind-address): 'x.x.x.x'; port: xxxx
[Note] - 'xxx.x.x.x' resolves to 'xxx.x.x.x';
[Note] Server socket created on IP: 'xxx.x.x.x'.
[ERROR] Unix socket lock file is empty /opt/bitnami/mysql/tmp/mysql.sock.lock.
[ERROR] Unable to setup unix socket lock file.
[ERROR] Aborting
Originally I thought the SSL thing was the issue but someone else pointed out that this is just a warning.
Ultimately I was able to fix this by just backing up the lock file (just in case) and then removing it:
# Back that thang up
sudo cp /opt/bitnami/mysql/tmp/mysql.sock.lock /opt/bitnami/mysql/tmp/mysql.sock.lock.backup
# Remove it
sudo rm /opt/bitnami/mysql/tmp/mysql.sock.lock
# Fire it up again
sudo /opt/bitnami/ctlscript.sh start mysql

Cannot start Mysql 5.7 on cent 0s 6.10

I am trying to setup MySql 5.7 on CentOS 6.10. I've installed MySQL but when I try to run sudo service mysqld start, it is not starting. The error is
2018-11-05T17:14:57.569757Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2018-11-05T17:14:57.573328Z 0 [Note] mysqld (mysqld 5.7.24) starting as process 10355 ...
2018-11-05T17:14:57.575610Z 0 [ERROR] Fatal error: Please read "Security" section of the manual to find out how to run mysqld as root!
2018-11-05T17:14:57.575652Z 0 [ERROR] Aborting
2018-11-05T17:14:57.575671Z 0 [Note] Binlog end
2018-11-05T17:14:57.575741Z 0 [Note] mysqld: Shutdown complete
I guess it is something to do with selecting the user type as root but I'm not able to figure out what to do. Can someone help?Thanks in advance
It looks like mysqld is configured to run as the root user right now, which is not a recommended way for it to run--hence the hard warnings forcing you to change your configuration. You should instead run as the mysql user that was created for you when you installed the package.
You can see the user mysqld is set up to run under by looking in the [mysqld] section of my.cnf. It seems most likely you have user=root, or the command line flag of --user=root is being applied.
Best practice would be to configure it to use the non-privileged mysql user instead.
Relevant documentation:
The How to Run MySQL as a Normal User documentation page indicates that:
the MySQL server mysqld should be started by the local mysql operating system user. Starting by another operating system user is not supported by the init scripts that are included as part of the installation.
MariaDB (a fork of MySQL) provides a documentation page called Running mysqld as root which indicates:
MariaDB should never normally be run as the system's root user (this is unrelated to the MariaDB root user). If it is, any user with the FILE privilege can create or modify any files on the server as root.
MariaDB will normally return the error Fatal error: Please read "Security" section of the manual to find out how to run mysqld as root! if you attempt to run mysqld as root. If you need to override this restriction for some reason, start mysqld with the user=root option.
Better practice, and the default in most situations, is to use a separate user, exclusively used for MariaDB. In most distributions, this user is called mysql.

Changed root MySQL password to an empy string now I can't access database

I wanted to get rid of the password requirement for my MySQL and (stupidly) thought I could just change it to an empty string. I ran the command:
mysqladmin -u -p[mypassword] password ''
I received a warning message that "single quotes were not trimmed from the command line client as you would expect".
I now get access denied for all password attempts including my old password, explicitly putting in '', leaving it blank.
I have run the command mysqld --skip-grant-tablesas I have seen suggested in other questions but this has no effect, I still get access denied after running this command.
I have also tried following the guidance here https://dev.mysql.com/doc/refman/8.0/en/resetting-permissions.html#resetting-permissions-windows and I get the folowing output at which point the command does nothing.
C:\Program Files\MySQL\MySQL Server 8.0\bin>mysqld --console --init-file=C:\\Users\Tobyb\Documents\mysql-init.txt
2018-08-20T12:09:50.433487Z 0 [System] [MY-010116] [Server] C:\Program Files\MySQL\MySQL Server 8.0\bin\mysqld.exe (mysqld 8.0.12) starting as process 14300
2018-08-20T12:09:52.193012Z 0 [Warning] [MY-010068] [Server] CA certificate ca.pem is self signed.
2018-08-20T12:09:52.245255Z 6 [ERROR] [MY-011071] [Server] 1105 Bootstrap file error, return code (0). Nearest query: ''
2018-08-20T12:09:52.248615Z 0 [System] [MY-010931] [Server] C:\Program Files\MySQL\MySQL Server 8.0\bin\mysqld.exe: ready for connections. Version: '8.0.12' socket: '' port: 3306 MySQL Community Server - GPL.
Is there any other way for me to regain acces to my database or change the password?
Thanks
Edit: Due to time constraints I've gone for the nuclear option and, thankfully having backup sql files, done a complete reinstall of MySQL Server. For anyone who may come across this problem and it still hasn't been solved, if you do a clean install be sure to delete all remaining MySQL Server files, otherwise the the problem will persist after the reinstall. Preferably use an uninstaller such as revo.
try mysqladmin -u ,'' is not empty password

ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) after reinstalling mySQL twice

Login attempts and Error messages
I have included an image which shows all the login attempts i made including -h localhost and -h 127.0.0.1.
I have even checked for space issues and haven't had any issues regarding that.
I was able to access the databases 2 days ago and today it's giving me this error.
I have seen the purge and reinstall would solve this issue and have already done that to previously run mySQL and wouldn't want to do that every time i have that issue.
Please look into the errors i am getting and suggest a way to tackle it.
I am open to provide more additional data if requested or as required.
Thanks in advance.
This is what i found in var/log/mysql/error.log
2018-06-12T13:59:38.147016Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2018-06-12T13:59:38.507148Z 0 [Warning] InnoDB: New log files created, LSN=45790
2018-06-12T13:59:38.579416Z 0 [Warning] InnoDB: Creating foreign key constraint system tables.
2018-06-12T13:59:38.647136Z 0 [Warning] No existing UUID has been found, so we assume that this is the first time that this server has been started. Generating a new UUID: d8a93ee9-6e48-11e8-b5af-32306b28cd52.
2018-06-12T13:59:38.648977Z 0 [Warning] Gtid table is not ready to be used. Table 'mysql.gtid_executed' cannot be opened.
2018-06-12T13:59:38.650160Z 1 [Warning] root#localhost is created with an empty password ! Please consider switching off the --initialize-insecure option.

XAMPP - Error: MySQL shutdown unexpectedly

I have reinstalled XAMPP for some reason and MySQL is not working, giving the following error in the console:
01:56:03 [mysql] Error: MySQL shutdown unexpectedly.
01:56:03 [mysql] This may be due to a blocked port, missing dependencies,
01:56:03 [mysql] improper privileges, a crash, or a shutdown by another method.
01:56:03 [mysql] Check the "/xampp/mysql/data/mysql_error.log" file
01:56:03 [mysql] and the Windows Event Viewer for more clues
When checking the "/xampp/mysql/data/mysql_error.log" file I get:
130302 1:48:06 InnoDB: Waiting for the background threads to start
130302 1:48:07 InnoDB: 1.1.8 started; log sequence number 1600324627
130302 1:48:07 [Note] Server hostname (bind-address): '0.0.0.0'; port: 3306
130302 1:48:07 [Note] - '0.0.0.0' resolves to '0.0.0.0';
130302 1:48:07 [Note] Server socket created on IP: '0.0.0.0'.
130302 1:51:12 [Note] Plugin 'FEDERATED' is disabled.
130302 1:51:12 InnoDB: The InnoDB memory heap is disabled
130302 1:51:12 InnoDB: Mutexes and rw_locks use Windows interlocked functions
130302 1:51:12 InnoDB: Compressed tables use zlib 1.2.3
130302 1:51:12 InnoDB: Initializing buffer pool, size = 16.0M
130302 1:51:12 InnoDB: Completed initialization of buffer pool
130302 1:51:12 InnoDB: highest supported file format is Barracuda.
InnoDB: The log sequence number in ibdata files does not match
InnoDB: the log sequence number in the ib_logfiles!
130302 1:51:12 InnoDB: Database was not shut down normally!
InnoDB: Starting crash recovery.
InnoDB: Reading tablespace information from the .ibd files...
InnoDB: Restoring possible half-written data pages from the doublewrite
InnoDB: buffer...
130302 1:51:13 InnoDB: Waiting for the background threads to start
130302 1:51:14 InnoDB: 1.1.8 started; log sequence number 1600324627
130302 1:51:14 [Note] Server hostname (bind-address): '0.0.0.0'; port: 3306
130302 1:51:14 [Note] - '0.0.0.0' resolves to '0.0.0.0';
130302 1:51:14 [Note] Server socket created on IP: '0.0.0.0'.
130302 1:56:01 [Note] Plugin 'FEDERATED' is disabled.
130302 1:56:01 InnoDB: The InnoDB memory heap is disabled
130302 1:56:01 InnoDB: Mutexes and rw_locks use Windows interlocked functions
130302 1:56:01 InnoDB: Compressed tables use zlib 1.2.3
130302 1:56:01 InnoDB: Initializing buffer pool, size = 16.0M
130302 1:56:01 InnoDB: Completed initialization of buffer pool
130302 1:56:01 InnoDB: highest supported file format is Barracuda.
InnoDB: The log sequence number in ibdata files does not match
InnoDB: the log sequence number in the ib_logfiles!
130302 1:56:01 InnoDB: Database was not shut down normally!
InnoDB: Starting crash recovery.
InnoDB: Reading tablespace information from the .ibd files...
InnoDB: Restoring possible half-written data pages from the doublewrite
InnoDB: buffer...
130302 1:56:02 InnoDB: Waiting for the background threads to start
130302 1:56:03 InnoDB: 1.1.8 started; log sequence number 1600324627
130302 1:56:03 [Note] Server hostname (bind-address): '0.0.0.0'; port: 3306
130302 1:56:03 [Note] - '0.0.0.0' resolves to '0.0.0.0';
130302 1:56:03 [Note] Server socket created on IP: '0.0.0.0'.
That is just a part of the log, the full one is a bit too big.
Help?
Make sure you backup the mentioned folders before taking any action!
This worked for me,
Quit the XAMPP
Cut all files in C:\xampp\mysql\backup
Paste and replace files into C:\xampp\mysql\data
Run the XAMPP as administrator
In my case, I did two things:
moved xampp/mysql/backup files into xampp/mysql/data
RUN XAMPP as Administrator
It worked for me :)
First you need to keep copy of following somewhere in your hard disk.
C:\xampp\mysql\backup
C:\xampp\mysql\data
After that
Copy every thing inside "C:\xampp\mysql\backup" and paste and replace it in
"C:\xampp\mysql\data"
Now your mysql will work in phpmyadmin but your tables will show "Table not found in engine"
For this you will have to go to the copy of "backup and data folders"
which have created in your hard disk and there in the data folder copy
"ibdata1" file and past and replace in the "C:\xampp\mysql\data".
Now your tables data will be available.
Caution! Don't delete ibdata1 file!
Just follow these steps and its done.
Rename the folder C:\xampp\mysql\data to C:\xampp\mysql\data_old (you can use any name)
Create a new folder C:\xampp\mysql\data
Copy the content that resides in C:\xampp\mysql\backup to the new C:\xampp\mysql\data folder
Copy all your database folders that are in C:\xampp\mysql\data_old to C:\xampp\mysql\data (skip the mysql, performance_schema, and phpmyadmin folders from C:\xampp\mysql\data_old)
Finally copy the ibdata1 file from C:\xampp\mysql\data_old and replace it inside C:\xampp\mysql\data folder
Now Start MySQL from XAMPP control panel
And its all done, Enjoy...
If your skype is open, Quit skype and try,
or
Go to your xampp/wamp installed, search for httpd.conf.
Open that file using textpad/notepad, search for Listen or 80 ,
update listen port to 8081 and save the file.
Restart xampp/wamp, start the servers.
or follow below steps in skype
Rename the folder mysql/data to mysql/data_old (you can use any name)
Create a new folder mysql/data Copy the content that resides in mysql/backup to the new mysql/data folder
Copy all your database folders that are in mysql/data_old to mysql/data (skipping the mysql, performance_schema, and phpmyadmin folders from data_old)
Finally copy the ibdata1 file from mysql/data_old and replace it inside the mysql/data folder
Start MySQL from the XAMPP control panel
If Apache is running without any issue , and u find some blockage by system security settings , simply allow it instead of blocking or closing the dialog box.
And change the port number for MySQL to 3607 as it was before 3606 .
It worked for me .
To resolve this,
Go to your XAMPP folder,
XAMPP -> mysql -> bin -> "my.ini"
After opening my.ini configuration file, Replace 3306 with 3308 in couple of places, because 3308 is a free port.
XAMPP -> php -> "php.ini"
Do the same as you did in "my.ini" file which is changing port 3306 to 3308.
Then, restart the XAMPP server.
It works fine.
There may be MySQL server installed previously in your computer try to uninstall that and start MySQL at the XAMPP This solved mine
the true way is RECONFIGURE your app.with setup of MYSQL .you can open your setup again and change port from 3306 to 3307.
I would simply try reinstalling XAMPP.
one reason I found ( and not mentioned in addition to other answers given in this site on the similar problem ) was by going to task manager in windows and stopping the mysqld which was running already and prevented mysql server from starting.
You must:
Close the xampp
Go to the folder where you installed it, if in (c:) may be something like C:\xampp\ , access folder C:\xampp\mysql\data
Delete the file ibdata1
Starts XAMPP again.
The best solution for this problem is just open your mysql configuration directive file my.ini present inside the folder C:\xampp\mysql\bin and change the information related to the ports, usually some programs occupy the port no. 3306 as a result of that it stops working, Now you follow two steps to make it working.
enter code here
Step-1. Search for ['client'], you can see some thing like this
[client]
# password = your_password
port = 3306
socket = "C:/xampp/mysql/mysql.sock"
Now in the port section remove 3306 and add port = 3306 > 3307 as shown below.
[client]
# password = your_password
port = 3306 > 3307
socket = "C:/xampp/mysql/mysql.sock"
Step -2. Similarly Search for ['mysqld'], you can see something like this
[mysqld]
port= 3306
socket = "C:/xampp/mysql/mysql.sock"
basedir = "C:/xampp/mysql"
tmpdir = "C:/xampp/tmp"
datadir = "C:/xampp/mysql/data"
pid_file = "mysql.pid"
# enable-named-pipe
key_buffer = 16M
max_allowed_packet = 1M
sort_buffer_size = 512K
net_buffer_length = 8K
read_buffer_size = 256K
read_rnd_buffer_size = 512K
myisam_sort_buffer_size = 8M
log_error = "mysql_error.log"
Now here change the port number 3306 to 3307 and add a line "innodb_force_recovery = 1" exactly as shown below.
[mysqld]
port= 3307
socket = "C:/xampp/mysql/mysql.sock"
basedir = "C:/xampp/mysql"
tmpdir = "C:/xampp/tmp"
datadir = "C:/xampp/mysql/data"
pid_file = "mysql.pid"
# enable-named-pipe
key_buffer = 16M
max_allowed_packet = 1M
sort_buffer_size = 512K
net_buffer_length = 8K
read_buffer_size = 256K
read_rnd_buffer_size = 512K
myisam_sort_buffer_size = 8M
log_error = "mysql_error.log"
innodb_force_recovery = 1
Thats it, restart you mysql service, it will work for sure.
For anyone that searched and pressed on this link, i solved it by simply searching for mysql notifier and stop mysql from running there, Then run mysql in xampp again and it runs. why this works ? iam not expert, but i think it is easy : port was taken already by mysql notifier so had to stop it there and run it here.
I am new to XAMPP, but I find that a combination of these suggestions works best (At least on Windows 8.1 with the latest version of XAMPP. Note that the computer I tested this on, also had skype).
First logon to skype and navigate to "Tools < Options < Advanced < Connection."
Then check the box that says "Use port 80 and 443 for additional incoming connections." Save, close, and quit skype.
Next, on your XAMPP control panel, click "config < my.ini" and change lines 19 and 27 (should have port = 3306) from "3306" to "3307."
Also, you will need to navigate to xampp < phpMyAdmin < config.inc and change line 27, which should like something like this:
$cfg['Servers'][$i]['host'] = '127.0.0.1';
You will need to add "3307" as follows:
$cfg['Servers'][$i]['host'] = '127.0.0.1:3307';
Now, open your browser and you should see the xampp page when you type in "localhost."
Additionally, if this is your first time using xampp, you may see a warning about your lack of password (highlighted in pink) on your localhost/phpmyadmin/ page. This is easily remedied by going to the "user accounts" tab in phpmyadmin, clicking on "edit privileges" and entering password. Remember to save the hashed version of any and all passwords you create as we will use this next! -I opened a notepad and saved (and numbered) them. Note that phpMyadmin will notify you of when you are changing the password for your current session (this will be displayed at the top of your phpMyadmin page and is very important, as you will need THAT specific hashed version of your password).
Next, you will need to navigate to the following location "xampp < phpMyAdmin < config.inc" on your computer and open and edit the file with a text editor. You will want to put in the hashed version of your password between the single quotes for password and change "AllowNoPassword" from true to false.
And, that ought to do it.
In my case :
I have just replaced
....xampp/mysql/backup files
into
**xampp/mysql/data**
It worked for me.
if you inistalled mysql Independently
you can stop mysql service if running
no one of these answers are worked for me
this work for me
Well first thing ,, I know its late so I dont know if anyone will upvote it but oh well its okay,,
secondly, uninstalling xampp might not do you any good because the process using the port 3306 (Mysql's default port) will still be running somewhere on your system. might be skype, but might not be skype.
so the best way would be to find out which process is using port 3306, and then terminate the process.
so to find out which process is using port 3306, open command prompt, and type
netstat -n -o -a
you will get a screen like
this.
Then look for the address with port number 3306
and find out the PID corresponding to that.
Then simply open a command prompt as administrator and type
taskkill /F /PID 1234
replace 1234 with your respective PID.
Then you can try starting mysql and it will work.
And now if you are lazy to do this step all over again when restarting the computer,,,
you can simply use the following batch script to terminate the process automatically and enjoy :)
#echo off
setlocal enableextensions
set "port=3306"
for /f "tokens=1,4,5" %%a in (
'netstat -aon ^| findstr /r /c:"[TU][CD]P[^[]*\[::\]:%port%"'
) do if "%%a"=="UDP" (taskkill /F /PID %%b) else (taskkill /f /PID %%c)
endlocal
pause
save it as anything.bat and run it everytime you want to use mysql. :)
**
-> "xampp->mysql->data" cut all files from data folder and paste to another folder
-> now restart mysql
-> paste all folders from your folder to myslq->data folder
and also paste ib_logfile0.ib_logfile1 , ibdata1 into data folder from your folder.
your database and your data is now available in phpmyadmin..**
I did all methods but didn't find the perfect solution!
Install Laragon instead of Xampp , You will pray for me.
In my case I had to go to C:\xampp\mysql\data and delete all files (not folders) but keep ibdata1 and my.ini. Restartet XAMPP, everything running again.
Hope that helps someone - had to look for hours before finding that!
just run your xammp as an administrator, it works