A new client has requested shell access so they can manage there database via command line...below are quotes from the client, looking for any help with resolving there issue...
We gave him jailed access at first...
Hello, I understand the concern. The reason I ask is because the bulk of my MySQL management is done through Shell. I update my databases by uploading CSV text files, then via Shell, empty the old tables and populate them with the new data. I know this can also be one via PHPAdmin, but that doesn't work because my files are pretty large andI cannot upload them via an online form. I have to upload them using FTP, then using Shell extract them to MySQL. I wrote a simply .sh script that does all this for me. I may be able to do this with a cron job as well... I think.
I do this once a week do update my stores data tables, so this would have to permanent.
If this is a problem, I'll see if I can figure out another way to do it not using Shell.
I do this with my current host, so I'm not sure of an alternate way of doing it. I also need to unzip files via Shell commands, but I see CPanel has an extract function in file manager that may work
Hi again, now that I'm able to access via Shell, I cannot seem to tap into my MySQL databases. When I try to access MySQL to populate my database tables it says:
"Can't connect to local MySQL server through socket '/disk3/mysqldata/mysql.sock'"
I'm assuming this is restricted on the server side. If that is the case, my work-around was just to run the MySQL commands through PHPMyAdmin. The problem I seem to be having is I'm not sure what the absolute path is to my files. I'm trying to upload a CSV file to my server via FTP, then run the MySQL command:
"LOAD DATA INFILE "/home/redrumme/test.txt" REPLACE INTO TABLE cscart_products FIELDS TERMINATED BY '|';"
To populate the data from this text file to the table specified. The problem is, everytime I try to run that through MySQL is gives me the following error:
#1045 - Access denied for user 'redrumme'@'localhost' (using password: YES)
Is my path above to the text file incorrect for the server I am on?
I added my IP address to the list in Cpanel for Remote MySQL access. No luck. It still will not allow me to access MySQL over Shell. I get the following error:
Error 2002 (HYOO): Can't connect to local MySQL server through socket '/disk3/mysqldata/mysql.sock'
I also double-check my Shell commands and I am including the entire name of the database and username. I'm using the following to try and access it:
mysql -uredrumme_newcart -ppassword_omitted redrumme_eStore
We then gave them bash shell access.
I was able to access my MySQL databases now through Shell, but it doesnt seem to like the "LOAD DATA INFILE" command. It says "Access denied for user 'redrumme_newcart'@'localhost'"
This is the same error I was getting in PHPMyAdmin when I tried to run LOAD DATA INFILE. I tried to figure out what the problem is on the Internet and it appears that I have to have FILE permissions in the MySQL users table to allow me to use the LOAD DATA INFILE command.You probably know more about this than I do though.
Reading about this, I guess there is an alternate "LOAD DATA LOCAL INFILE" that can be used and no permissions need to be granted but when I run that it says "The used command is not allowed with this MySQL version"