appear and disappear. Do you have an error message or a problem?
I thought so because it's oracle cloud free tier I think it's something like 1Gb of ram
so I accidentally removed mysql package there and I can't seem to start mysql.service after reinstall and all google and stackoverflow saying is I need to match the .sock file but I can't find where it is
Did you install mysql separately or with xampp?
separately by sudo apt install mysql-server. should I try installing xampp?
No. that's your choice. And, if that command didn't give you any error, you should be able to use mysql without any issues. Guess your service need to be started again, after installation. Try this: sudo service mysqld start. If you still couldn't, see if you have file(s) named do rm -rf /var/lib/mysql/ib_logfile* (* intended). And then, restart mysql with systemctl restart mysql.
thank you so much for your advice. Here's what I tried so far. hope it's not too redundant. - I tried to remove package completely by sudo apt-get purge mysql-server mysql-client and sudo rm -rf /var/lib/mysql - after rebooting instance I installed mysql-server by sudo apt update; sudo apt install -y mysql-server - and after sudo reboot, I tried sudo mysql_secure_installation: failed - sudo service mysqld start returned Failed to restart mysqld.service: Unit mysqld.service not found. - sudo service mysql start returned Job for mysql.service failed because the control process exited with error code. See "systemctl status mysql.service" and "journalctl -xe" for details. journalctl -xe shows Apr 23 23:37:00 instance-20-04 sshd[4603]: Received disconnect from 112.169.84.32 port 42918:11: disconnected by user Apr 23 23:37:00 instance-20-04 sshd[4603]: Disconnected from user canor 112.169.84.32 port 42918 - I tried to check if mysql is configured correctly but /etc/mysql doesn't exist, nor does /var/run/mysqld or /var/lib/mysqld, but sudo apt install mysql-server didn't return any error message while installation. - /var/log/mysqld doesn't exist either. - ib_logfile* can't be there as I removed the whole directory before reinstall. - so I mkdired /etc/mysql and sudo vi /etc/mysql/my.cnf adding configuration as below user = mysql pid-file = /var/run/mysqld/mysqld.pid socket = /var/run/mysqld/mysqld.sock port = 3306 #basedir = /usr datadir = /var/lib/mysql tmpdir = /tmp #lc-messages-dir= /usr/share/mysql skip-external-locking - now sudo journal -xe shows Apr 23 23:52:32 instance-20-04 sudo[5495]: pam_unix(sudo:session): session opened for user root by canor(uid=0) Apr 23 23:52:34 instance-20-04 systemd[1]: mysql.service: Start request repeated too quickly. Apr 23 23:52:34 instance-20-04 systemd[1]: mysql.service: Failed with result 'exit-code'. -- Subject: Unit failed -- Defined-By: systemd -- Support: http://www.ubuntu.com/support -- -- The unit mysql.service has entered the 'failed' state with result 'exit-code'. Apr 23 23:52:34 instance-20-04 systemd[1]: Failed to start MySQL Community Server. -- Subject: A start job for unit mysql.service has failed -- Defined-By: systemd -- Support: http://www.ubuntu.com/support -- -- A start job for unit mysql.service has finished with a failure. -- -- The job identifier is 5157 and the job result is failed. Apr 23 23:52:34 instance-20-04 sudo[5495]: pam_unix(sudo:session): session closed for user root - As far as I can think, line PIDFile=/var/run/mysqld/mysqld.pid in /lib/systemd/system/mysql.service is causing problem as there isn't such directory, and .pid file but I have no idea how to handle this. your advice would be very appreciated. thanks!
You've mentioned that you ran sudo apt-get purge on both mysql-server & mysql-client. But, you've stated of running only sudo apt install -y mysql-server. I'm not sure if you've installed the client too, but the fact that you /etc/mysql doesn't exist would actually mean that you haven't installed the client. Try the purge again & install both the server & the client. After this, you should be able to see both /etc/mysql and /lib/systemd/system/mysql.service. (The advice on creating the /var/run/mysqld was given (I guess, you got it from SO or some other forum), only because it's a temp folder (created @ run-time). It might have been marked as read-only folder due to some user restrictions & so it's possible that your current user couldn't create the file at run-time. Hence the recommendation, to create it manually. However, It is not advisable (nor is of any help) to create the system/application folders like /etc/mysql, as they're created during installation & hence become the proof that you have the application installed. Refrain from creating these folders & be cautious about removing them too.)
thank you so much for your help. I removed /var/lib/mysql /lib/mysql and /etc/init.d/mysql after purging mysql-server mysql-client, and reinstalling mysql-server and mysql-client somehow made it work. maybe old data in /lib/mysql was causing the issue? anyway issue solved thanks to you!!
Обсуждают сегодня