I am an Java developer new to MySQL.
I want to perform Load data operation using PHPMyAdmin. Load data scripts are verified as it worked pretty well on my Windows OS configuration.While trying to load data from CSV, i am getting :
The used command is not allowed with this MySQL version
Version details is as follows
Mysql Server version: 5.5.34-0
OS : ubuntu0.13.04.1 (Ubuntu)
I am done with editing the my.cnf as follows:
[mysql]
local-infile =1
#no-auto-rehash # faster start of mysql but no tab completition
.......................
[mysqld]
#
# * Basic Settings
#
local-infile =1
user = mysql
.........................
[client]
loose-local-infile=1
root
port = 3306
.........................
I have tried restarting apache and mysql multiple times using -
sudo service mysql restart
sudo service apache2 restart
Nothing worked for me that help me to perform the operation using phpmyadmin. While using below command
mysql -u root -p --local-infile test
I am able to perform the Load data operation successfully through mysql prompt. Since i have multiple CSV in chunks and SQL load scripts for each chunk so i want to run it as a whole(load scripts seprated by $) in one go using phpmyadmin.
Please help me to solve this problem.
I have already gone through below answers on stack overflow
ERROR 1148: The used command is not allowed with this MySQL version
LOAD DATA LOCAL INFILE gives the error The used command is not allowed with this MySQL version
[UPDATE]
Variable local_infile is showing as 'ON', I have verified this using SQL query on phpmyadmin
SHOW VARIABLES LIKE "local%"
Load script
LOAD DATA LOCAL INFILE 'full_dir_path/man_final.csv'
INTO TABLE `manufact_t`
FIELDS TERMINATED BY ','
ENCLOSED BY '"'
ESCAPED BY '\\'
LINES TERMINATED BY '\r\n'
IGNORE 1 LINES
(man_sr,man_name, address, phone, fax, email, url,subdivision, #man_parent, man_id)
set man_parent=0;
my friend. There can be few reasons of this error.
php.ini has wrong value for mysql.allow_local_infile. Must be - mysql.allow_local_infile = On
If you are working locally you can try to remove the LOCAL from your SQL query. Maybe MySQL server settings just don't allow you to use the LOCAL keyword
Only if you use cPanel: The problem is the phpMyAdmin that is built into the cPanel interface doesn't use the php built with apache. So you can rebuild apache all day long and it will not change how php is compiled [from cPanel forum]
Hope this will help you.
My friend,
kindly us the following steps:-
Firstly, remove any current installations of MySQL server
run command in terminal sudo apt-get --purge remove mysql-server
go ahead and obtain the source files and other packages required to compile and install the source.
run command sudo apt-get install mysql-source-5.5 build-essential libncurses5-dev cmake
5.Go to the directory where the source is.
The best part while installing from source is that you may configure as per your need like DENABLED_LOCAL_INFILE
Kindly follow below link:-
http://www.sudo-juice.com/install-mysql-5-5-from-source-ubuntu-linux/
I have fixed this problem by removing LOCAL keyword. Please remove LOCAL keyword from the command, it will work for mysql server version 5.5.34-0.
Related
Im running put of patient with SELinux and that stuff...
I have httpd and myslqd running on the same machine with CentOs 6, and both services have their configuration files in a nfs directory exported from another machine.
Everything works fine with Selinux disabled... but when I set it to enforcing, PHP scripts can not communicate with mysql service. Httpd service works fine and mysqld too, if I run "mysql -u root" I can make queries to the database perfectly, but php scripts can not.
I think I'm missing some sebool that allows php to use mysql or something like that, but i can not find the key... some help?
You can set the following flag to allow Apache to connect to a database.
setsebool -P httpd_can_network_connect_db on
The -P option makes the change persist across reboots. You may need sudo to execute this command.
I host a Phabricator instance on a Ubuntu machine.
How do I uninstall Phabricator totally, including all config files and settings.
I already removed all three folders cloned from git, and uninstalled mysql-server using
sudo apt-get purge --auto-remove mysql-server.
However, when I run install_ubuntu.sh to install back again, the old admin account, the log for Daemons logs, and the site settings are still there in website.
How can I remove all configuration and data completely?
The problem most likely is that uninstalling the MySQL server does not delete databases. You have a couple of options.
Probably the best way to delete the data would be to run Phabricator's bin/storage destroy command. This is the best approach, because it does not make any assumptions about how Phabricator stores its data (MySQL, files etc.). Install Phabricator, MySQL and all other dependencies again, and look for bin/storage in Phabricator installation directory.
Another way would be to install mysql-server and mysql-client, launching the mysql command line client and dropping all databases starting with phabricator_.
If you really want to mess with database files directly, you can find them in /var/lib/mysql.
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)
So I was trying to reset my MySQL password on my Raspberry Pi and it seems that my database crashed or is now inaccessible.
I was following the section called, “B.5.3.2.2 Resetting the Root Password: Unix and Unix-Like Systems” of the official MySQL documentation.
As soon as I ran:
kill `cat /var/run/mysqld/mysqld.pid`
Then input:
# sudo service mysqld restart
I’d get:
# mysqld: unrecognized service
I hope that I didn’t just nuke my entire database. Can someone help?
You are following generic MySQL instructions for a Linux setup when you are on a Raspberry Pi using Raspbian (I assume).
All that message means is the service named mysqld is unrecognized by your system. It does not mean it has crashed or data was lost. It just means your OS doesn’t know what mysqld is as far as services go. That’s it; nothing to panic about.
A quick Google search shows that Raspbian uses a different system service name simply known as mysql. So to start it up again just run this command:
sudo service mysql start
And you should be good to go. Also note that whole command you ran to stop the service is overkill:
kill `cat /var/run/mysqld/mysqld.pid`
Running a kill command like that should only happen when all other options are exhausted and you truly want to stop the database server. The way you should be stopping, starting and generally controlling the MySQL server is via the service interface using a command like this:
sudo service mysql stop
And if you wanted to restart the service, just run this command:
sudo service mysql restart
Past any of that if you are stuck with an “unrecognized service” message, then you can always check the stuff in the /etc/init.d directory on your Linux machine like this:
ls -la /etc/init.d/
Look through that list and find the exact name of the service you need to do something with and then just run the service command as outlined above.
I have been using mySQL for a few weeks now with PHPMyAdmin with no problems. But just lately it stopped working - MySQL server will run for a few seconds when I start my machine (Mac OS X 10.9.5)then it crashes and wont restart. It also wont let me log in PHPMyAdmin.
When i try to run mysql through terminal it returns the following error:
Can't connect to local MySQL server through socket '/tmp/mysql.sock
I'm not really sure what could cause this after it working for so long.
mysql on the command line/terminal is just another MySQL client, like phpMyAdmin or your web application. The error you're seeing is the same error as phpMyAdmin is displaying. On linux/OSX the command is actually mysqld (d for Daemon or server).
Homebrew/Macports/etc installs
During installation it should have installed a launchctl script. Find it on the terminal with ls ~/Library/LaunchAgents/ and inspect the output, in my case:
homebrew.mxcl.lighttpd.plist
homebrew.mxcl.mysql.plist
homebrew.mxcl.php55.plist
There in the middle - now I can use launchctl to start it at the terminal:
$ launchctl load ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist
Although the handy launchctl script is called "mysql" it's actually launching mysqld, usually from /usr/local/bin/mysqld
Standard MySQL install
If you installed MySQL directly from their website, you should have a "MySQL" option in your System Preferences. From there you can stop/start the service.
If you didn't install mysqld with a package manager, perhaps you installed/compiled it yourself, then search your disk for mysqld and launch it from the command line or find an init.d folder with a mysqld script inside.