Xampp/ Lampp Mysql access - php

I install on Ubuntu 16.04 LTE Xampp (lampp) all good It Works:
:~$ sudo /opt/lampp/lampp start
Starting XAMPP for Linux 5.6.20-0...
XAMPP: Starting Apache...already running.
XAMPP: Starting MySQL...ok.
XAMPP: Starting ProFTPD...already running.
:~$ sudo /opt/lampp/lampp status
Version: XAMPP for Linux 5.6.20-0
Apache is running.
MySQL is not running.
ProFTPD is running.
:~$ sudo service mysql start
:~$ sudo /opt/lampp/lampp status
Version: XAMPP for Linux 5.6.20-0
Apache is running.
MySQL is not running.
ProFTPD is running.
But when I want to enter the TERMINAL has mysql -u root:
ERROR 1698 (28000): Access denied for user 'root'#'localhost'
And if i use sudo mysql -u root, all is ok I can use mysql by terminal.
But for Firefox http://127.0.01/phpmyadmin/ :
Welcome to phpMyAdmin
Error
MySQL said: Documentation
Cannot connect: invalid settings.
Connection for controluser as defined in your configuration failed.
phpMyAdmin tried to connect to the MySQL server, and the server rejected the connection. You should check the host, username and password in your configuration and make sure that they correspond to the information given by the administrator of the MySQL server.

I would check the permissions under /var/lib and /var/run
I had a similar situation and solved by changing the permission on those folders then run
$./etc/init.d/mysql start

Related

Getting "The server requested authentication method unknown to the client" error when using SRDB tool

Update
I solved this issue by switching MAMP and SRDB ports from 3306 to 3307 and I get rid of the error. There already seems to be a mysql service on 3306 as seen below.
➜ ~ sudo lsof -i tcp:3306
COMMAND PID ... NAME
mysqld 800 ... localhost:mysql (LISTEN)
Therefore I switched to port 3307 and now is working.
➜ ~ sudo lsof -i tcp:3307
COMMAND PID ... NAME
mysqld 84660 ... *:opsession-prxy (LISTEN)
Original Issue
I am getting the below error when using the search and replace DB tool (SRDB) both the browser interface, and via terminal. I feel like whatever MySQL service the SRDB tool is connecting to is setup with SHA256 authentication plugin as appose to Native MySQL. However I have confirmed that my user in the MAMP db is setup with Native MySQL Password plugin.
Error
SQLSTATE[HY000] [2054] The server requested authentication method unknown to the client
Versions
OS: MacOS Mojave
MAMP:
- Web & MySQL ports set to 80 & 3306
- PHP 7.3.8
- MySQL 5.7.26
PHPMyAdmin: 4.9.0.1
Steps Tried
I have tried using all the different versions of MAMP php binarys to execute the script
/Applications/MAMP/bin/php/php5.6.40/bin/php ./srdb.cli.php ......
Some versions at least tell me that whatever SRDB is connecting to is set to accept SHA256
PDO::__construct(): The server requested authentication method unknown to the client [caching_sha2_password]
db: SQLSTATE[HY000] [2054] The server requested authentication method unknown to the client
I have tried changing the version of MySQL locally with homebrew and then running the terminal and browser applications, which made no difference
brew install mysql#5.7.26
export PATH="/usr/local/opt/mysql#5.7/bin:$PATH"
I have tried updating user to make sure I am using Native MySQL Authentication with the following command executed within PHPMyAdmin
ALTER USER 'username'#'localhost' IDENTIFIED WITH mysql_native_password BY 'password'
Steps to Reproduce on MacOS
Install MAMP
Run servers
Download SRDB tool
Open tool / run in terminal

Can't start MySQL: "Could not find domain for" running mysql on macos (Laravel Valet)

I'm trying to get a local mysql up and running on my macos machine. I am following theese instructions: https://laravel.com/docs/5.7/valet#installation
I am installing through Homebrew.
I have tried reinstalling mysql
I have two users: an administrator to install things, and a normal user account for my developing and normal activities. Perhaps this is what's causing the issues
What I expect:
MySQL to run every time I boot up my macbook as it used to do (no matter what user account I am logged into, preferably).
Error:
When I try to connect through Sequel Pro or running mysql -u root directly, I get error: ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
What I have tried
sudo brew services restart mysql#5.7. Running with success but mysql still doesn't work.
[admin:~]$ brew services start mysql#5.7 error Could not find domain for Error: Failure while executing; /bin/launchctl enable gui/501/homebrew.mxcl.mysql#5.7 exited with 112.
Followed instructions of: MacOSX: autostart mysql on boot
Tried starting manually from my normal user account: [myuser:~]$ mysql.server start error: Starting MySQL ./usr/local/Cellar/mysql#5.7/5.7.24/bin/mysqld_safe: line 144: /usr/local/var/mysql/mymacname.local.err: Permission denied
So I finally found the solution, turned out it was quite simple. I tried reinstalling several times, etc, but in the end what worked was to fix the permissions brew didn't manage to, after a installing via brew.
Running
sudo chown -R _mysql:mysql /usr/local/var/mysql
Then restarting the mysql server:
sudo brew services restart mysql#5.7
Solved the issue 🤓👍🏽

mysql connection error: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) Godaddy Cpanel

My website was working fine till yesterday. But it suddenly started showing this error:
mysql connection error: Can't connect to local MySQL server through
socket '/var/lib/mysql/mysql.sock' (2)
I don't think I made any changes except adding the site to alexa. I googled this and found a lot of resources but all those couldnt help me because I did not fully understand them. I am also not able to locate the file mysql.sock.
I want to know if my website has been hacked. Plus, the solution to the problem.
Might want to start with checking all your db configuration and make sure you did not overwrite or accidentally changed something?
If not that, then try restarting your mysql server. Not sure what Linux env your running, but whichever one it is, Google how to restart mysql.
You could also try and restarting apache. I think the command for that is
sudo service apache2 reload
sudo service apache2 restart
sudo service mysql restart
Then verify if mysql is running on the socket, run this command to see the process
ps aux | grep mysql
this is simple. Run this on commandline
mysql -uroot -p -hlocalhost
sudo service mysql restart
mysql -u root -p
I hope that works.

Unable to start XAMPP properly

I am facing the below issue while starting the xampp on linux box.
I am able to start the mysql and proFPD but i couldn't satrt the apache.
It showing another webserver is already running.
XAMPP: Starting Apache fail.
XAMPP: Another web server is already running.
XAMPP: Starting MySQL already running.
XAMPP: Starting ProFTPD already running.
- if you start lampp and are fetching apache starting issue run below
command
sudo /etc/init.d/apache2 stop && sudo /opt/lampp/lampp start
Seems like you have httpd daemon running already.
Go to terminal and type service httpd stop
Then try starting XAMPP

Cant configure LAMP on kali linux

Hello guys is me again now I have some problems configuring LAMP
first of all i have install everything but I cant run test.php to see if php works according to ifconfig command my addr is: 192.168.1.77 So in browser when I try to run 192.168.1.77/test.php nothing happens.I follow the instructions in this video to do that. How to set up a Debian LAMP Server
Second when I try to change the password on mysql I got this error by the way I can't do anything that has to do with mysql. when I run this command apache2 -v && mysql -v && php -v
I got this error.
Server version: Apache/2.2.22 (Debian) Server built: Feb 1 2014
21:26:04 ERROR 2002 (HY000): Can't connect to local MySQL server
through socket '/var/run/mysqld/mysqld.sock' (2)
when I try to run this command /usr/bin/mysqladmin -u root password 'mypassword' i got this error.
/usr/bin/mysqladmin: connect to server at 'localhost' failed error:
'Can't connect to local MySQL server through socket
'/var/run/mysqld/mysqld.sock' (2)' Check that mysqld is running and
that the socket: '/var/run/mysqld/mysqld.sock' exists!
I follow this guide to LAMP, Linux Apache MySQL PHP But since I have those problems with mysql i can't finish the proper configuration. so thank you very much for any help or comments have and have a nice day.
Doing a quick search might be able to point you the right direction, did you install this?
apt-get install mysql-server
It seems to be complaining about mysqld which is the mysql-server program perhaps try this too:
service mysql start
You will see this:
[ ok ] Starting MySQL database server: mysqld ..
[info] Checking for tables which need an upgrade, are corrupt or were
not closed cleanly..
Notice how it says mysqld
If that doesn't work try this maybe:
apt-get install --reinstall mysql-server
Hopefully this helps a bit
Kali blacklists services by default using sysvinit, so if you've been rebooting it could be tripping you up:
http://docs.kali.org/policy/kali-linux-network-service-policies

Categories