Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    MYSQL




Does Mysql Support Referencing Files In *.sql Script Files ?


does mysql support referencing to other files inside a .sql file ? for example to include several files into one file for sak of simplicity ?




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
MySQL & Files
Does anyone know how I can store files (mostly pictures) into a mySQL
table? I have tried the load_file function but it seems to not work.
i just get NULL as the value.

Any examples would be most appreciated. I am using RH9 and the latest
version of mySQL.

I know I should be storing the links on disk and the save a pointer in
the table but I want to put the files actually in the database.

What Are /var/lib/mysql/www-bin.nnn Files?
There are about 30 /var/lib/mysql/www-bin.nnn files in my system,
where nnn is a running number (001...030). Some of them are >1GB
in size and the timestamps are old. What are they and what is the
correct way to get rid of them?

MySQL & Files
Does anyone know how I can store files (mostly pictures) into a mySQL
table? I have tried the load_file function but it seems to not work.
i just get NULL as the value.

Any examples would be most appreciated. I am using RH9 and the latest
version of mySQL.

I know I should be storing the links on disk and the save a pointer in
the table but I want to put the files actually in the database.

Getting .myd And .myi Files Into Mysql
I was given raw .myd and .myi files that need to be exported into access (or something readable, excel, etc). I downloaded mysql, but how do I get these files from my hard drive into mysql so I can do the export? I have the server up and running, but I dont see anywhere to put existing data?

MySQL Files
In error I deleted my ibdata files and log files. Someone told me I needed to delete my .frm files to correct my problem and start MySQL. I did... can anyone tell me what I need to do from here?

Can These Mysql Files Be Deleted?
I'm trying to do some house cleaning on my server. I run a few mysql db's, for forum software and just starting a link directory.
In the mysql dir I see:
-rw-rw---- 1 mysql mysql 25088 Oct 7 2005 ib_arch_log_0000000000
-rw-rw---- 1 mysql mysql 5242880 Mar 12 20:23 ib_logfile0
-rw-rw---- 1 mysql mysql 5242880 Oct 7 2005 ib_logfile1
-rw-rw---- 1 mysql mysql 18874368 Mar 12 20:23 ibdata1

I'm trying to reclaim some space and wonder if these are all log files and if I can delete them without harming my system. I'm not brave enough to just move them to find out if my DB's complain.

/var/lib/mysql/base-bin Files?
I run a hsoting company and we have a dedicated server. Our server details are at below:

OS: CentOs 4.5

Recently I have discovered server disk usage is getting bigger with no reason. I have googled the issue and find out exim temp files were getting very big. I have deleted them.

Also I have figured out /var/lib/mysql/ directory is another large directory. In the directory there are base-bin files. Can you tell what these base-bin files for. I do not think they are neccessary for server but I did not want to delete them without knowing what they really are.

MySQL 5 Is Generating BIG Files
I've installed MySQL 5 in my linux box (gentoo), it's working ok, but it is generating big files in the database directory (in my case, /var/data/mysql).

The files has the format "pcname-bin.000001",000002,000003...000060 . I have 60 files with 1 GB of space per file in my hard disk.

What can I do??? Is possible to limit this files?? Can I delete it?

MySQL Replication Log Files
I have a MySQL 4.1 running on a SLES server (SuSE), and the DBA has left the company.  The mysql/var directory is filled with large MySQL Replication logs from the past two months.  Its filling up the 64GB filesystem, using 60G of the space.  How can I clean this up?  

Can I just delete the old log files, or will that break something?   I don't believe any replication is even happening with another server so I'm not sure why this is even turned on.

Mysql Development Files?
Where would I find mysql development files for mysql 4.1 and red hat 7?

I know red hat 7 is old but that all I have for right now...

I need the developer files specially those that deal with headers.

I am just quoting from instructions I have for this application.

Backup Mysql From Files
Is it sufficient if I just backup (copy) the whole data deirectory of my mysql installation somewehere else?

If something happens and I want to restore the databases, is it as simple as copying the backed up files, back to the original location?

Do I need to backup something else (eg an sql script) for the sructure of the tables and the databases, or the whole "data" folder is the only thing I need?

VB App For MySQL Backup Files
how I can create a VB app to connect to a remote MySQL server at a set time and backup a remote db to local file?

Although a lot of the tools I have seen backup to a text script file, a more
compressed binary version would be better.

Mysql Temp Files
I have a problem with mysql server version 3.23.41
Some temporary files are created and named #sql1b5_1868c3_0.MYD.
The size is about 130 GB and they are continuosly updated by the mysql server.
I tried to stop the mysql server. In this way the temporary files were deleted but the the databases were corrupted.

FRM Files In MYSQL Are Invisible
I am using MYSQL 4/ RHL7.2 when i installed mysql all are the types (frm,myi and myd ) are available there. but when i untarred some files downloaded from the infected machine(missing frms there also) our server also affected.

This is in our what i got from our server:

shell# ls -l users.*
-rwxr-xr-x 1 mysql mysql 6908 Jul 16 19:44 users.MYD
-rwxr-xr-x 1 mysql mysql 3072 Jul 16 19:44 users.MYI

shell# ls -l users.frm
-rwxr-xr-x 1 mysql mysql 9312 May 22 18:40 users.frm

when u access this thru php_admin, i can' see any tables showing.

mysql> show tables;
Empty set (0.00 sec)

But actually the tables are present which is shown below.

mysql> select count(*) from users;
+----------+
| count(*) |
+----------+
| 78 |
+----------+
1 row in set (0.00 sec)

CAn anybody come up with a solution for this?

Include Files In Mysql
I have downloaded the free version of QT and build a graphical shell with QT designed. This runs fine after a compilation with VC++ 6.0. Now I want to add mysql-functions by linking with a mysql lib-file.

But this didn't work at all. When I include mysql.h without any mysql-code in my program I get this errormessage:

c:mysqlincludemysql_com.h(116) : error C2146: syntax error : missing ';' before identifier 'fd'

This seems normal as the compiler didn't have a clue what my_socket is in line 116 mysql_com.h.

my_socket fd; /* For Perl DBI/dbd */

After some research I found this in my_global.h that now is included:

typedef int my_socket; /* File descriptor for sockets */

But now this errormessage appears:

c:mysqlincludemy_global.h(420) : error C2040: 'pchar' : 'int' differs in levels of indirection from 'char *'

Why aren't all include-files independent of each other and include the files they need? This was how it works when I made programs for Amiga and it works great.

Necessary Files Required To Run Mysql DB
When installing the application into clients machine i want to install mysql 5.0 also.
But i don't want to install full mysql5.0 onto clients machine.Is it possible to copy some dll files and register it and able to connect to the MySql from java application.

MySQL And Video Files
Would mySQL work well as a media repository for video files? For instance if I am adding 20MB-120MB Quicktime files as binary data would anyone see any objections or downsides?
It would be delivered via a web app and hosted on a standard off the shelf box.

60 Gb Of Mp4 Files In MySQL Database
I have a client who wants to store around 60 Gb of mp4 files for download on his website. Can MySQL store mp4 files? Would it be better to store all the videos in a zip file for bulk download also in a table in MySQL database?

How do I finish these tables to store Mp4 files and how do I create a table to store Mp4 files?

CREATE TABLE `mp4s` (
mp4ID INT(10) NOT NULL AUTO_INCREMENT,
PRIMARY KEY (`mp4s`)
)
ENGINE = MyISAM
CHARACTER SET utf8 COLLATE utf8_general_ci;

CREATE TABLE `zipped_mp4s_courses` (
courseID INT(10) NOT NULL AUTO_INCREMENT,
PRIMARY KEY (`courseID`)
)
ENGINE = MyISAM
CHARACTER SET utf8 COLLATE utf8_general_ci;

VB App For MySQL Backup Files
Has anybody got any pointers or examples on how I can create a VB app to
connect to a remote MySQL server at a set time and backup a remote db to
local file?

Although a lot of the tools I have seen backup to a text script file, a more
compressed binary version would be better.

Anyway 2 Store Files On Mysql?
anyway 2 store files on mysql? liek a text file something?

MySQL Header Files
Ok, I am trying to install php with apache and mysql. I am using this command:

./configure --with-mysql=/usr/local/mysql --with-apache=../httpd-2.0.54

But I'm getting this error:

configure: error: Cannot find MySQL header files under /usr/shared/mysql

So, does any one have any idea on where to find my header files and what they may be?

MySQL Not Making MYD Or MYI Files
I installed MySQL server 5.0 on my computer and have a problem. I create a database and create a table within it, then populate the table. At this point (on my old computer) I would copy the new database files to our webserver. However, on the fresh install, the folder only contains the .frm file, not the .MYD or .MYI files.

I'm looking in C:Program FilesMySQLMySQL Server 5.0data emp just for reference.

Open MySQL Files
Is there a danger limit to how many often used files (tables) mysql can have open.
I currently run mysql and it has about 3000 tables total, thats 9000 open files in total if you cound 3 files for each table.

MySQL Data Files
I created a testDB - filled it with hundreds of megs of data. Went to myPHPadmin after testing - and deleted the testDB database.

After deleting the database - the data files still state the following:

1bdata1 = 220Mbs of data
ib_logfile0 and ib_logfile1 are 10Mbs each.
How do I purge the MySQL Database - or should I have to worry about it? Will this adventually take care of itself on it's own or can I do something to purge this data - from these files?
Yes - I'm a newbie when it comes to MySQL.
Using latest version of Wamp5.x

MySQL Packages/files
I'm trying to download mySQL for my linux box. Can someone explain the difference between standard, server, max, source, gamma and beta?

Where Are Mysql Table Files Stored?
Can anyone tell me the default location for mysql data table files on a linux server please?




Can't Import Dump Files In Mysql 5
I apologize upfront if this is common knowledge. I've searched for quite a while and found nothing concrete.

Using phpmyadmin 2.6.4-pl4
MySQL 4.0.23-nt
php 4.4.4

When I export and make a sql file, I cannot import the data using this setup:

phpmyadmin 2.6.4-pl4
MySQL 5.0.24a-community-nt
php 4.4.4


Get "No SQL query!" message through phpmyadmin when I import the .sql file. If I cut and paste out the create table or insert text it works, but that takes forever. If I copy the data files to the data folder everything works in mysql 5.

The sql files I've tried have been from 2-4 mbs. My backup dumps are 80 mbs though and obviously worried about restoring backups. Is there something I missed when upgrading? I pretty much copied off my data, uninstalled mysql 4 and installed mysql 5. Not in strict mode. Dataserver is in another location so can't always go copy the files off manually. Thanks for any help.

MySQL Limits On Large Files?
I am developing a secure file upload/download site.

My approach is to use an account driven system which allows for file upload/download.
The files will be "absorbed" into the database directly, as opposed to leaving them on the web file structure.
The file downloads will be by "releasing" from the database.

My basic application operates currently, however, I am running into a limit problem.

I cannot upload beyond 17MB file.

I am on WinXP, PHP v 4.3.10, MySQL v 4.1.8, and access to Apache v2.0.52 (port 80) and Abyss v 1.2.3.0 (port 8000).

I have learned that these variables with upload influences are...

PHP: file_uploads = on
PHP: post_max_size = 30MB
PHP: upload_max_filesize = 30MB

MySQL: max_allowed_packet = 30MB

Installing MySQL 5.0 From Downloaded Files
I need installation assistance to get MySQL 5.0 downloaded and running on Red Hat 9.0. Unsuccessful after at least a dozen attempts.

Importing Txt Files Into MySQL Database
For a long time I've been considering converting all the information on my homepage from php based to database based but I've always put it off because I have no idea how to go about doing this.

My main problem is that I have thousands of .txt files that have information like in this example that are imported into a webpage using php.

-----
homersimpson.txt

firstname=Homer
lastname=Simpson
maritalstatus=Married
relatives=Marge (wife), Bart (son), Lisa (daugter), Maggie (daughter)... etc
hometown=Springfield
-----

and so on. Sometimes the order in the files is different and "lastname=" comes before "firstname=" and so on which makes it practically impossible for me to turn the files into a tab or commaseparated files.

Now what I'm interested in knowing is whether or not there is a way for me to import such txt files into MySQL so that the first names, last names and so on go in the right tables? And if there is how is it done?

Importing A MySQL Database From .frm, .myi And .myd Files
I have the contents of a MySQL database sitting in a folder. Each file
in the folder is an ISAM table that is comprised of three files, its
..frm, .MYI and .MYD. I would like to import this database on another
MySQL installation running on another machine. I thought it would be
as simple as mysqladmin create <database_name> and then navigating to
the databases data directory and dropping in the ISAM files, however,
when I connect to the database using mysql I get "Didn't find any
fields in table <table_name>" for each of the 16 or so tables I tried
to copy over.

Cant Find Mysql Header Files
I'm attempting to configure PHP with apache and mysql support, but the config fails, because it can't find the mysql header files.

I have mysql installed and working,
these are the rpms installed:
MySQL-client-4.0.21-0
MySQL-server-4.0.21-0
MySQL-shared-compat-4.0.21-0

When configuring PHP, I'm using this:
[root@tunes mysql]# ./configure --with-apache=../apache_1.3.31 --with-mysql=/usr/bin/mysql

This is the Error:
configure: error: Cannot find MySQL header files under /usr/bin/mysql

When I search for mysql.h, I get this:
[andy@tunes local]$ locate mysql.h
/home/andy/snort/snort-2.2.0/src/win32/WIN32-Includes/mysql/mysql.h
/usr/local/src/php-4.3.9/ext/dbx/dbx_mysql.h
/usr/local/src/php-4.3.9/ext/mysql/php_mysql.h
/usr/local/src/php-4.3.9/ext/mysql/libmysql/mysql.h
/var/www/html/php_tarball/php-4.3.9/ext/dbx/dbx_mysql.h
/var/www/html/php_tarball/php-4.3.9/ext/mysql/php_mysql.h
/var/www/html/php_tarball/php-4.3.9/ext/mysql/libmysql/mysql.h

correct me if I'm wrong, but shouldn't the path be something like /usr/bin/mysql or /usr/lib/mysql or /usr/sbin/mysql ?

I've tried all of these paths and they don't work.

MySQL 5.0 Copy Of DB Binary Files
I'm using MyDQL 5.0 with Administrator 1.2.11 on an XP OS. I'm attempting to copy a database by simply copying the data directory and binary files, and then renaming it. MySQL Admin can see the new database and I can connect to it via ODBC. While the MySQL Admin catalog for this DB lists all the tables, it displays an error that all the tables do not exist.

Mysql Logs Files - How To Flush
I see some log files that are taking up 20 megs. How do I get rid of these, view them or work with them.

Using mysql 4.0.24

I have attempted the following:

E:mysql2in>mysqladmin.exe -u root -p -v flush-logs
Enter password: *******

E:mysql2in>mysqladmin.exe flush-logs -u root -p
Enter password: *******

However I still see the following files:

01/05/2006  11:49 PM        10,485,760 ibdata1
05/11/2005  03:44 PM            25,088 ib_arch_log_0000000000
01/05/2006  11:50 PM         5,242,880 ib_logfile0
05/11/2005  03:44 PM         5,242,880 ib_logfile1

Maintaining History Files In Mysql?
I am running a site with php and mysql. I want to keep the record of all add, update, delete/DML queries which daily run on mysql server in a file. how can i take the history of all those queries in a file.

What Files Are Need From The /mysql/data Folder??
obviously the DB folders are needed

but can i delete

servername.err
ib_logfile0
ib_logfile1
ibdata1

from an old directory and move the DB folders to a new installation??

I Need To Put References To Files In Mysql Tables
I am using Mysql 3.28 What I see that in VARCHAR it holds maximum 255 chars. I need to be able to store them more than 2000 chars. But my data details are very long for each sequence number. So what I am doing is that put the data for each sequences into file1, file2, file3 for those data.

So for an instance :

seq_no (PK)
SEQ_DETAILS (255)

I would like to insert data as:

1, file1
2, file2

etc.

How do I insert the files into Mysql table. I could do this MSAccess or SQL Server. But in Mysql I dont know how. And then How when I run a query to find particular seq_details, how it will pull the data out?

MySQL Limits On Large Files?
I am developing a secure file upload/download site.

My approach is to use an account driven system which allows for file upload/download.
The files will be "absorbed" into the database directly, as opposed to leaving them on the web file structure. The file downloads will be by "releasing" from the database.

My basic application operates currently, however, I am running into a limit problem.

I cannot upload beyond 17MB file.

I am on WinXP, PHP v 4.3.10, MySQL v 4.1.8, and access to Apache v2.0.52 (port 80) and Abyss v 1.2.3.0 (port 8000).

I have learned that these variables with upload influences are...

PHP: file_uploads = on
PHP: post_max_size = 30MB
PHP: upload_max_filesize = 30MB

MySQL: max_allowed_packet = 30MB

Any others?

I changed my upload script to process the file in 2 parts:
1) Upload the file to the web site
2) Import the file into the database.

Results:
1) The file appears on the web site properly
2) Problem encountered "MySQL server has gone away".

Inserting Data Into Mysql Db From XML Files
I'm writing an application that saves files in XML format and into a mysql database. Is there a better way of getting the data from the XML files to the database than generating queries for every element in the file?

MySQL Store Multimedia Files
I am hiring a programmer to build an application that will serve and store multimedia content.  It will need a database backend and I am wondering if MySQL can store multimedia (audio and video) files or if it is not powerful enough.

Also, are other database options better suited to this need?

Mysql Header Files Located On Rh9
Im trying to install snort and the installation calls for the location of
the mysql.h header file.

Ive tried what I think are the default locations, and if I run a locate
nothing turns up.

I have rh9 with the mysql package installed, and im trying to compile snort

Index And Data Files In Mysql 3.23
I have 3 mysql replicated servers ( 1 master + 2 slaves). One thing I
noticed is that every once in a while the data (*.MYD) and index (*.MYI)
files for a table may differ from the other mysql servers. Now my
question is this:

If I have identical data files on each server (verified by using
checksums), should the indexes generated be identical on each mysql
server? If not, is there something wrong? Is it possible for mysql to
generate 2 different and ok indexes from identical data files?

I am using

Mysql 3.23.58
myisam tables.

Zip Files Be Uploaded To A Mysql Server
I have a html form that allows files to be uploaded to a mysql server, max file size 2mb. I have a page that lists all the files as links and when clicked allows the files to be saved or opened.

It works a treat with all types of files and validates if over  2 mb.

However if I try to upload a zip file and then attempt to open it the archive is not recognised.

Is this because zip files cannot be uploaded to the mysql server?

MySQL Upload Small Files
I'm uploading small files (>10K) and mysql is deleting it. The one field is a blob field and everytime i test upload a file thru phpMyAdmin within 2 seconds mysql deletes the row. Theres nothing in mysqld.log, there another log i should be checking out?

Storing Pointers In Mysql To Video Files On HDD
I need a PHP/Mysql website to have video files for viewing/downloading. I'm not sure whether to store the files in the database, or to keep the large video files on the disk, and store in the DB only the pointers to file locations on the disk. It seems that storing only the pointers makes more sense.

What do you think?

How can I store pointers to file locations on the disk? I don't know where to start. If I have the video files on the disk, and I want to store their locations in the DB, so that people can click on a link to view them, what do I do?

Help! Trouble Loading .txt Files Into MySQL Front
spent all night entering data into my 1st DB via "mySQL front" and this morning had to reinstall everything, so i lost the whole DB but i did export it as a .txt & html table file last night.. but now i can't seem to get it back :mad:

here is what the exported .txt file looks like:

id,artist,title,label,price,sound
1,Niko Bellotto ,Slam mode,La colecion,21.50,slam_mode.mp3
2,Oliver Ho,Listening to the voice inside,Meta,40.50,oliver.mp3
3,Numero Deux,The dinning rooms,Conesa,32.50,numero.mp3
4,Photek,Solaris,Omni,32.50,photek.mp3
5,Gianni Ferrio,Spring themes,Garden,32.50,spring.mp3

..... more of the same..

(its for an online cd store (fake one)
i created a table with the same fields and tried to "import .txt file" but all i get is the id field filled up? the other fields stay blank?

What Naming Convention Does Mysql Use For Database Files? Where Does It Put Them?
I asked mysql to create a database named credifree (see below)
and later checked for filenames on the system like *credifree*
but I found nothing indicating that mysql created any filenames
like *credifree* - ideas as to why not?

From the captured screen-text below, you can see that the
credifree database does indeed exist...

mlh@appserver mlh $ mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or g.
Your MySQL connection id is 4 to server version: 4.0.22

Type 'help;' or 'h' for help. Type 'c' to clear the buffer.

mysql> use credifree
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
mysql> show tables;
+------------------------+
| Tables_in_credifree |
+------------------------+
| paylog |
| secure_pdf |
| systemlog |
| tbiccreceiptsefx |
| tbiccreceiptsexp |
| tbiccreceiptstu |
| tbladdrchangesefx |
| tbladdrchangesexp |
| tbladdrchangestu |
| tbladdressesequifax |
| tbladdressesexperian |
| tbladdressestransunion |
| tblaftermath |
| tblbureaus |
| tblcfclientchanges |
| tblcfnegchanges |
| tblcr_types |
| tblcredifreeclients |
| tblcredifreenegs |
| tblcreditreports |
| tblhits |
| tblinboundtypes |
| tblinstructions |
| tblmemberlogins |
| tblmerchandise |
| tbloutboundtypes |
| tblprefixes |
| tblreasons |
| tblremoved |
| tblsales |
| tblsleepers |
| tblsuffixes |
+------------------------+
32 rows in set (0.00 sec)

mysql> select * from tblhits;
+------------+----------+
| DateHit | HitValue |
+------------+----------+
| 0000-00-00 | 79417 |
| 2004-09-30 | 76 |
| 2004-10-01 | 16 |
| 2004-10-04 | 11 |
| 2004-10-06 | 24 |
| 2004-10-07 | 20 |
| 2004-10-08 | 37 |
| 2004-10-10 | 9 |
| 2004-10-11 | 4 |
| 2004-10-12 | 19 |
| 2004-10-13 | 13 |
| 2004-10-14 | 7 |
| 2004-10-15 | 8 |
| 2004-10-16 | 30 |
| 2004-10-17 | 31 |
| 2004-10-18 | 26 |
| 2004-10-19 | 3 |
| 2004-10-21 | 9 |
| 2004-10-22 | 10 |
| 2004-10-23 | 5 |
| 2004-10-24 | 7 |
| 2004-10-25 | 21 |
| 2004-10-26 | 12 |
| 2004-10-27 | 4 |
| 2004-10-28 | 4 |
| 2004-10-29 | 7 |
| 2004-10-30 | 4 |
| 2004-10-31 | 20 |
| 2004-11-01 | 11 |
| 2004-11-02 | 4 |
| 2004-11-03 | 4 |
| 2004-11-04 | 7 |
| 2004-11-07 | 1 |
| 2004-11-08 | 18 |
| 2004-11-09 | 11 |
| 2004-11-10 | 38 |
| 2004-11-11 | 41 |
| 2004-11-13 | 1 |
| 2004-11-15 | 18 |
| 2004-11-16 | 11 |
| 2004-11-17 | 9 |
| 2004-11-18 | 7 |
+------------+----------+
42 rows in set (0.00 sec)

How To Convert MySQL Tables To Binary .dat Files
I have some mysql tables that I need to convert to binary files with .dat extension for some testing. Could anyone tell me how I can do that using the console, or any mysql tools like Navicat?

How Do I Move MySQL Database Files From Drive C: To D: ?
When we installed MySQL 5.0.45 (on Windows XP), we took the default installation directory specifications, which placed our MySQL instance's data files in:

C:Program FilesMySQLMySQL Server 5.0data

Our C: drive is full. We have 140 GB of free space on D:. We would like to relocate our MySQL "...data" directory onto the D: drive.

We have been unsuccessful in locating in the documentation how to make this happen.

Can someone please either"

1) direct me to a link in the doc to accomplish this or

2) post the steps we must follows to successfully relocate the contents of our "...data" directory from C: to D:?


Copyright © 2005-08 www.BigResource.com, All rights reserved