Mysql Service doesnt show but can login and is running - mysql

OK something odd and maybe im missing something simple here. I am trying to diagnose a problem I think that max connections are being reached and need to up them. Upon further looking I ran # service --status-all and then I noticed that mysqld was not in the list so I tried service mysqld status which returned mysqld: unrecognized service . but if I run mysql - p MYPASS I am logged in to mysql and can see all my databases as normal. also I log into phpmyadmin just fine all databases are there. Also have several scripts running using 'localhost' and my mysqlusername and pass, and they are running just fine...
So I am not sure why I am not seeing the mysql service, anyone have some idea? or can point me in some direction?
I am using Centos, I did not set this machine up that person is no longer here, I have several other servers running mysql as well and I checked all those all is right.

It sounds like the service has not been registered.
On a working box do;
chkconfig --list mysqld it should return something like;
mysqld 0:off 1:off 2:off 3:on 4:off 5:off 6:off
Now do the same on the box in question - if nothing comes back then you need to chkconfig --add mysqld then re run the above commands to verify its registered, then you should be able to access it via the service manager.

Related

Unable to connect to localhost:3306 (2003) for MySQL 8.0.21 on Windows

I am using MySQL workbench to connect to my local server. Everything was running fine and suddenly I jumped in a connection refused errors. I tried restarting the server again and again. Clearing temp files and also restarted my machine. I found this post from which I tried a couple of things like net stop and stopping the process from the services list but in the services list it shows as below:
I waited like for 30 mins but still, the service is not stopped.
Also, below is the screenshot for MySQL workbench when I try to start the server:
Is there anything specific which I need to do in order to resolve this error:
So, I resolved my own problem in this way. I referred the documentation for this particular error and for my error which is of 2003 type it said that look for mysqld.exe process in task manager and if you don't find any then start the server. But, in my case I found 2 mysqld.exe processes running. So, I killed those processes and restarted the server. It worked!!
Might help someone someday :)

I can't start MySQL server in NodeJs after reset MySQL password using Windows's cmd

I reset my MySQL password using cmd commands from this guide.
cd "C:\Program Files\MySQL\MySQL Server 8.0\bin"
mysqld
--defaults-file="C:\\ProgramData\\MySQL\\MySQL Server 8.0\\my.ini"
--init-file=C:\\Users\\<username>\\resetMYSQL.txt
resetMYSQL contains a command to change password
ALTER USER 'root'#'localhost' IDENTIFIED BY '<myNewPassword>';
Now, it turned out I have to keep running the mysqld command above to start my server or else I'll get this error. If I run the command again I can flawlessly run my server until I terminate it.
This is the error. It's ECONNREFUSED.
I think my password is already reset, because apart from the command line, I also run ALTER USER in Workbench after I got access to it while the cmd is running.
Btw, before this I can just start my server using Node and Sequelize and didn't have to start server elsewhere or set anything beforehand
I'm not sure what is the problem here, so I don't know which keyword I should look up on Google. I googled the error code, but those cases seems unrelated to mine.
I'd be glad if you can explain me what's going on.
The nodejs error message you showed us, a ECONNREFUSED message with a traceback, shows the your mysql database server program was not running when your nodejs program tried to connect to it. Nodejs reaches out to MySQL via TCP/IP. TCP/IP responds "I don't know any MySQL." Specifically, it responds "ECONNREFUSED on port 3306," meaning "nothing on this machine accepts connections on MySQL's port."
nodejs does not start the mysql software for you. It connects to it and uses it.. MySQL has to be running already for that work.
Ordinarily, software like mysql runs in the form of a operating system service; a background process that runs all the time on the machine to await requests).
And, ordinarily, you don't provide init files to MySQL to do things like change passwords, except just once, if you must, to rescue something broken. In your case it looks like you forgot your MySQL password, so you needed to use an init file to rescue yourself. Once the password is reset, stop using that init file.
Explaining how to make MySQL run as a service on your machine is beyond the scope of a Stack Overflow answer. But the installers for MySQL, on almost every operating system, set it up to run as a service automatically. It's generally useless otherwise.

Apache cant connect to mysql

I have Centos 6 with MySQL 5.7 installed
when i restart computer and trying to access web site i recive next error:
Software error:
Can't connect to the database.
Error: Access denied for user ''#'localhost' to database 'bugzilla_DB'
Is your database installed and up and running?
Do you have the correct username and password selected in localconfig?
if i connect to server and restart HTTPD service all start working untill next restart.
i checked:
1. mysql starts a lot before httpd
2. waiting few minutes after server starts not help until i make httpd restart
3. mysql.pid and mysql.sock are ok
4. selinux disabled
5. iptables not used and disabled
6. no additional error in mysql.log
This seems to be related to your web site source code trying to access MySQL.
You need to enter the right connection (host and port) info and user credentials in your source code (wherever authentication is made).
This has nothing to do with (the erratic premise) that Apache connects to MySQL. It does not (in any normal out-of-the box installation).
This being said, you should still provide more information, the following statement requires more facts about your setup:
if i connect to server and restart HTTPD service all start working untill next restart.
I Found the problem. RiggsFolly was right. the problem in local config.
when HTTPD starts as service with boot that is limited environment and correct user required. when i make service restart after boot i logging in and service uses correct user environment and connects to MySQL as that user. so proper configuration of localconfig fixed the problem.
thanks to all of you.

phpmyadmin (wamp) not working anymore

I've played a little with php and data bases a few weeks ago and it worked perfectly. Now, when I tested the same thing again, I realized that it is not runnable anymore. More exactly, when I have to access the data base, I get the following type of notice:
Warning: mysqli_connect() [function.mysqli-connect]: [2002] A connection attempt failed because the connected party did not (trying to connect via tcp://localhost:3306) in E:\wamp\www\test\login.php on line 18
When I try to open http://localhost/phpmyadmin/ I get a blank screen
Please give me the possible explanations
You probably have another application using port 3306, another MySQL running perhaps?
The Possible explanation is
i suspect you have installed and uninstalled wamp? in that case you need to check you driver/etc/.hosts file under system32 ("Google it for exact path") :) and you have to make sure there exist only one value for
127.0.0.1 localhost
As it said above you need to check your running port has already used by another instance by checking
netstat -a and see if 3306 is Listening
Check on windows services that MySQL ,Apache are running or able to run automatically or manually from the service
suggest uninstall properly ==> delete all inside the wamp folder except www --takecare

MySQL Password Not Working

EDIT: I had MySQL installed twice on my machine (XAMPP & on its own)
When I enter my password into MySQL Command Line Client, it rejects my password, gives 1 beep and closes the window. Can anyone provide me with a basic troubleshooting list of steps (from simple to progressively more technical) to regain entry into MySQL once and for all. Also, can anyone tell me what can cause my password to suddenly be rejected? I am also running XAMPP and the MySQL service is both installed and running. Thanks in advance.
I remember when I first got this problem some months ago, if I recall correctly, I solved it by starting the MySQL service from Windows XP's Administrative Tool (something I did stopped the MySQL service and to this day I don't know what it was).
Now the problem has started back again but this time, when I checked Services, the MySQL service was already 'started'.
Any assistance will be appreciated. Thanks
I think I figured out why my password was not working. I had two versions of MySQL installed on my machine (XAMPP and MySQL 5.1). So I deleted the MySQL 5.1 and it worked.
For me (and my similar problem),
--password = mypass
didn't work, but
--password="mypass"
did.
Is there an error message when it rejects your password? I wonder if perhaps you are using an outdated client and running into this issue: http://dev.mysql.com/doc/refman/5.1/en/old-client.html
If you set mySQL to not begin running on startup, then you need to start it prior to attempting to login. This can be done via the command line, via the task manager if you configured it as a windows service, etc.
For example, here is an explanation of starting the service using cmd
Starting MySQL from the Windows Command Line | MySQL
Do you have the password for the root account? If so, try this from the command line?
mysql --user=root --password=your password here
or
mysql --user=root --password=your password here --database=MySQL
A bit too late but - If you have numeric characters in your password and are using the numpad on your keyboard, ensure that the numlock is ON. For some weird reason if you have numlock off MySQL will still interpret a keystroke. This wasn't very obvious to me since my laptop doesn't have a num lock indicator light, thats HP for yah :)
How to Reset the Root Password | MySQL
This is the services solution that was mentioned. Use this if you can't remember your root password.
I'd like to add another successful solution to this problem. I reran the installer (the msi), chose the repair option and everything was fixed.
My password suddenly worked again, so I took the following steps to change it:
Using Windows Command Prompt, navigate to MySQL's bin directory
Type: mysqladmin -uroot -p password yourNewPassword
Press Enter. You will be prompted for your password, enter it
If no error messages/beeps happen, your password was successfully changed
Log in using MySQL Command Prompt with your new password
What I don't understand is that WHY all of a sudden my password started back to work after approximately 24 hours? I wish I know so I can avoid this in the future.