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
Related
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 🤓👍🏽
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.
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
I've tried install LAMP to my Mac using this tutorial. I've installed MySQL from official site to my Mac (OS X El Capitan 10.11.3). I've written aliases for mysql and mysqladmin in .bash_profile. So when I try type mysql command it responses me with
error: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (38).
I've typed perror 38 and got next: Socket operation on non-socket. What's wrong?
I think mysql server is not running. Start it by
sudo /usr/local/mysql/support-files/mysql.server start and try again.
Make sure it is running by (sometimes mysqld will get killed if there is any error)
ps aux | grep mysql
my project on the remote server stopped working after i did the following
1> install putty
2> connect to the remote server using FTP details
3> then in the root server installed pear using
$ sudo apt-get install php-pear
4> then i changed the path in php.ini
now the server has stopped working ... why? what happened? HELP!!
I believe it might be superuser question.
Anyway, we need more details.
Assuming the server is running linux (/unix), check the logs - they will probably tell you why the server fails to start. Check both syslog (/var/log/syslog) and your server software specific log.