infodigger
asked on
Load .sql file into mysql through php
Hello,
I have a .sql file which contains a few queries and I need to load it into mysql. I tried two things, none of them worked:
1. Use file_get_contents and load the contents of the file into a php string and then use mysql_query to load them to the database. This didn't work at all.
2. Use load data command from mysql. This didn't work because I am on a shared hosting environment and I can't grand file access to the mysql user.
Is there any other alternative?
Thanks!
I have a .sql file which contains a few queries and I need to load it into mysql. I tried two things, none of them worked:
1. Use file_get_contents and load the contents of the file into a php string and then use mysql_query to load them to the database. This didn't work at all.
2. Use load data command from mysql. This didn't work because I am on a shared hosting environment and I can't grand file access to the mysql user.
Is there any other alternative?
Thanks!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER