I'm trying to upload a file to MySQL via MySQL client and keep getting a "#2006 - MySQL server has gone away" error. I looked into it and think it can be fixed by typing "mysql --max_allowed_packet=10MB". What folder do I have to cd to in order to use this command? I've looked into it but the folder varies greatly depending on what server is used. As such, I'm using Wampserver 2.5.
Run cmd command
Type c: or d: on command prompt. This will be based on your WAMP server installations.
Assuming you have installed wamp on D: drive.
cd D:\wamp\bin\mysql\mysql15.1.36\bin
D:\wamp\bin\mysql\mysql15.1.36\bin>mysql.exe -u root
Related
Hope someone can shed some light on this one, it's driving me nuts. I have a backup web app written in php, this creates an rsync which is run on a remote server and stores the files in a local folder. This function works using the php exec function.
We are migrating this to within a laravel8 app and the identical call to the same rsync and to the same local storage directory fails. The error is a 255.
If i use the same rsync command from command line it works the same as it does in our original app.
A bit more...
The Laravel instance is using Horizon to perform this so i have this in the handle() function of a process file in the jobs folder.
Of note I have a dev version of this laravel app and with this it works correctly and syncs with the remote folder.
My rsync command is using an id_rsa file for the apache user - www-data (the app is not available to the outside world). the folders have the correct permissions and owners (www-data and 755 for directories and 644 for files).
an example (modified version) of the rsync command:
rsync -rLDvcs -e "ssh -p 22 -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -i /var/www/.ssh/id_rsa" --no-perms --no-group --no-owner --progress --exclude-from '/var/www/backup/exclude.txt' --delete --backup --backup-dir=/hdd/mnt/incs/deleted_files/the-project/ theproject#188.102.210.41:/home/theproject/files/ /hdd/mnt/incs/theproject/files
the code which calls this is:
$aResult['res'] = exec($rsync . ' 2>&1', $aResult['output'], $aResult['return']);
when run $aResult['return'] has a value of 255 and the process has failed. The docs seem to say this is a failure to connect yet the identical call on another app on the same machine works (as it does if rsync is used in command line)
Any ideas? The php version on this box (the original app and the laravel upgrade) is php8.0 and my dev copy uses php7.4. my dev and this internal box use Ubuntu20.04 and apache2 so besides the php version are pretty identical.
No error is in any logs.
thanks
Craig
I have installed XAMPP on macOS with m1 chipset, and I am unable to run it through console, I have read several articles but all I was able to accomplish is that when I type source ~/.bash_profile I get /Applications/XAMPP/bin/php instead of /usr/bin/php but when I type mysql -p root -u and then show databases it does not show me preinstalled by XAMPP databases and on window it did, like the path was leading to some other directory than the one with the app installed but it kind of shows corect one, could you please advise me on that? This is my ~/.bash_profile
export XAMPP_HOME=/Applications/XAMPP
export PATH=${XAMPP_HOME}/bin:${PATH}
export PATH="~/.composer/vendor/bin:$PATH"
export PATH
So, I have recently installed Mysql Server in my Macbook (Mac OS 10.11) and I also installed Mysql Workbench and it works great!
The problem comes when I want to migrate form a Laravel Project using Php Artisan, every time I run the php artisan migrate command it return the following error
[PDOException]
SQLSTATE[HY000] [2002] No such file or directory
I also noticed I have to mysql installations i the following paths:
/usr/local/mysql
/usr/local/mysql-5.7.13-osx10.11-x86_64/ (this is the one I am using)
I placed in the .bash_profile a PATH to the new one (5.7.13) like this:
export PATH=${PATH}:/usr/local/mysql-5.7.13-osx10.11-x86_64/bin/
Do you guys know how can I fix this? Thank you for any help!
Path to the binary doesn't matter, in this case it's looking for a MySQL socket file.
Find your socket file (find / -name mysql.sock)
Ensure this path is set in my.cnf used by your PHP (you can run php -i |grep pdo_mysql.default_socket to see the default path)
As a workaround, you could set a symbolic link from 1 to 2 (eg. ln -s /usr/local/mysql/var/mysql.sock /tmp/mysql.sock) but ideally you want to set a correct path for PDO (or whatever MySQL extension you are using for PHP)
I have meshlab installed in my machine running Ubuntu 14.04 OS. I can access it from command line using meshlabserver command. But problem arises whenever I try to call it from a php script using the command
<?php
system('meshlabserver 2>&1');
?>
It shows the error meshlabserver: cannot connect to X server. After going through a few websites I did the following things:
I moved the meshlabserver executable from /usr/bin to /usr/local/bin and gave it executable permissions using
sudo chmod a+x meshlabserver
But when I ran the whoami command from my php script (calling the meshlabserver), it showed www-data. So I gave executable permissions for all users to the meshlabserver using
sudo chmod 777 /usr/local/bin/meshlabserver
But still it is showing the same meshlabserver: cannot connect to X server error. meshlabserver comamnd is working fine when ran from the command line.
I really need to call meshlab from the php script for my website. Thus any help would be highly appreciated. Thanks in advance.
It seems the php script can't access your display variable. If you logged in via ssh remember to tunnel your X-server via 'ssh -X ...' Your second option is to create a virtual frame buffer using Xvfb and redirect the display variable to it:
export DISPLAY=:100.0
Xvfb :100 &
Note the ampersand for the second command as Xvfb needs to be running in the background.
a combo of prior answers works for me:
ssh -X, as well as export DISPLAY=:0.0 (on remote)
I am setting up my first data base using XAMPP. I followed the steps from
dev.mysql.com/tech-resources/articles/mysql_intro.html
but as I try to connect to mysqlserver by typing "mysql -u root" into my Terminal I get back an error message:
Phosphoros:~ Arthur$ mysql -u root
-bash: mysql: command not found
Phosphoros:~ Arthur$
I am using Mac OS X 10.7.5.
How can I connect to the server?
Arthur
Your terminal application doesn't know where to locate the mysql program.
For example, if you installed xampp in C:/xampp, you open a command prompt, cd to C:/xampp/mysql/bin and then run your command, which should work now.
Edit: Just remembered you mentioned OSX, regardless, use the same principle. In your terminal, cd to the XAMPP install subfolder which contains the mysql executable app
you have to run the command: mysql -u root in the mysql directory that exists in the /opt/lampp directory.