Results 1 to 2 of 2

Thread: Importing large files into a MySQL database

  1. #1
    Administrator Jennifer's Avatar
    Join Date
    Jul 2010
    Posts
    99

    My Social Networking

    Add Jennifer on Facebook

    Importing large files into a MySQL database

    From time to time i have to insert really large files into MySQL. And sometimes there are problems because you don’t have access to the mysql command line utility from the server to issue the source command (this lets you import dumps or sql files). So you have to use phpMyAdmin or some other web based utility.
    But also too often one runs into the barriers set by PHP, specifically the configuration directives from php.ini: upload_max_filesize, memory_limit and post_max_size. If these are not set to a decent value you won’t be able to upload really large files and phpMyAdmin will fail. If you have access to these then you can modify them and you will have the ability to upload the files.
    But if not there is another solution. Open your config.inc.php from the phpMyAdmin directory and search for the following setting:
    $cfg['UploadDir']
    If it is present then modify it to point to a directory within the phpMyAdmin directory (you can call it “uploads”) or if not you can add it. Something like this:
    $cfg['UploadDir'] = ‘uploads’;
    Then you have to make sure that the directory “uploads” exists in your phpMyAdmin installation directory.
    That’s all, now when you want to import a file just upload it there (with an ftp client) in that folder and in phpMyAdmin at the import screen there will be a select with the sql files that exist in the directory. You can import this way really huge files.

  2. #2
    Administrator AP admin's Avatar
    Join Date
    Jul 2010
    Posts
    103
    extremely useful tip for me

Similar Threads

  1. How to access MySQL database using Perl
    By Meer in forum Database Administration
    Replies: 0
    Last Post: 10-10-2010, 07:43 PM
  2. PHP not connecting to a MySQL database server
    By Meer in forum Server Administration
    Replies: 0
    Last Post: 10-09-2010, 10:16 PM
  3. Dump mysql database on server, Free Mysql Dumper php Script
    By Jennifer in forum Database Administration
    Replies: 0
    Last Post: 08-26-2010, 01:32 PM
  4. Mysql database backup cron job
    By AP admin in forum Database Administration
    Replies: 0
    Last Post: 07-30-2010, 08:32 PM
  5. How to Backup MySQL Database to a file
    By AP admin in forum Database Administration
    Replies: 0
    Last Post: 07-28-2010, 08:06 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •