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




Restore Changes Case Of The Letters


When I restore the mysql database , the table names are changed to small letters ? any idea why ?




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Changing UPPER Case To Proper Case
I am fairly new to MySQL so any help on this would be much appreciated:

I have a column which stores TOWN in upper case, but I need this to be displayed as Proper case. I am using the following sql statement:

select CONCAT( UCASE(LEFT(address3,1)), LCASE(SUBSTRING(address3,2)) ) from consumer where id = 100.

This works fine given that there is only one string in the column, eg. HARROW becomes Harrow. However, when there is more than 1 string, this is where i get confused. eg, if i have HARROW-ON-THE-HILL in the column, i need it to be returned as Harrow-On-The-Hill.


BETWEEN Using Letters (A-Z)
I have to filter a query by the first letter in its name. I have a menu that looks like this:

A-E | F-J | K-O | P-T | U-Z

How would I gather, for example, records that start between A and E? Something like this:


SELECT *
FROM table
WHERE SUBSTRING(title, 1, 1) BETWEEN 'A' AND 'E'
I don't want to resort to using PHP like this:

PHP

$sql = "
   SELECT *
   FROM table
   WHERE SUBSTRING(title, 1, 1) IN ( ".implode(", ", $letters)." )
   ";

REGEX Everything But Letters
Tried a few various options making an area selectable by an alphabet list. At the start is a # that will cover that everything that doesnt begin with a letter.

The part of the query is:

WHERE animename
REGEXP '^[".$letter."]'
and for all the indevidual letters this is fine, but what would i have to use to get every character (_ , . $ ^ & " ! 1 through to9 EVERYTHING) except for letters.

Lol wasnt sure where to post this either since regex is pretty much in everything but chose here lol

Querying First 3 Letters
Can anybody tell me how to query the 3 order letters..

example is my code..

SELECT firstname, lastname, town, availability, expected_salary, keyword,dob,vacancy_type_id FROM rec_candidates WHERE keyword LIKE '%asp.net%';

Distinct Letters
my task is to build a smart keyboard (graphically of course) which shall know the existing letters in advance.

for that task, let's take a very simple table INTERPRET:

Id | Name
1, Beck
2, Bluestones
3, Blues Brothers
4, AC/DC
etc.

Now I would like all the distinct letters from Name of the first letter. The result would look like:
-> ['b','a']

Or let's consider the second letters of Name:
-> ['e','l','c']

can anybody give me a hint how the sql-command should look like?

Letters And Numbers
I'm working on a PHP form that allows for data entry into a MySQL DB. Some of the fields are radio buttons with values of 5,4,3,2,1, and 'NA' respectively.

In another part of the script I average the values of all the radio button groups. However, my script (or I think perhaps MySQL) is counting the 'NA' value as 0. What I'd really like is if MySQL (or PHP) were to count 'NA' as a null value that didn't register in a SQL averaging algorithm as a value.

Is there any way to make MySQL/PHP recognize that 'NA' is a value that is not be counted?

Letters With Diaeresis
I try to import data into the database using the command:
mysqlimport -hlocalhost -uasterisk -pasterisksql -Lv --default-character-set=utf8 --fields-terminated-by="|" --lines-terminated-by="
" rellinkweb_development ./laskutus_clients.txt
Everything is OK except that fields wich has letters with diaeresis (like äÄöÖ) do not imported.

Search By Letters (AA - AD)
I would send 2 variables to the page, $start and $end
e.g

$start = AA
$end = AD

I want to then select all records from the table which start with AA through to AD if this make sense?

Letters & Numbers?
Is there a way i can update a field for every record with a random letters OR numbers? Reason is i have 25,000 people in my mailing list but I have created a login for all the members but they have no password.

i want to randomly given them a password which is stored in the mySQL db.

i.e. UPDATE nn_users SET password = 'random';

Filter By First Two Letters Of Postcode
in a db table I have a field 'postcode'. The data it contains looks like:

BN12 4RF or
SE12 3ED for example.

It can also contain just one letter at the beginning, such as:
B1 2WQ

I need to be able to select all records from the table that, for example, the postcode starts with BN.

How do I isolate those two (or sometimes one) character to filter by?

Fulltext Index - 3 Letters
Is it possible to only allow certain 3 letter words (a handful)? The only obvious way I can think of is adding a ton of stop words.

Finding A Way To Omit Certain Letters.
I have a table with a field called CELL under this field I have rows with the following.

1X3V
1Y3V
1Z3V
.
.
.
.
.
up to
.
.
.
30X3V
30Y3V
30Z3v

I would like to find a function to omit the (X,Y,Z)3V and only output 1 - 30.

Can this be done?

Navigate Pages By First Two Letters Of Name
I am creating a PHP/MySQL application (if you can call it that). The purpose of this part of the project is to display all of the records in the database ordered by first name. Right now I am selecting each record according to the first letter of their name: A, B, C, etc using a URL parameter.

The flaw with this method is when there are only a few records for any given letter, and there are empty queries for letters like Z and X, but not all of the time, and as the list expands I wouldn't want to be changing the navigation. I believe a better method would be to create the query so that you navigate through the pages of the total records (ordered alphabetically ASC) by the first two letters of the first and last records on each page. I'm not advanced enough yet to know exactly how to do this and I was hoping I could get some help.

I hope I am explaining this well enough. The other information that would help you help me: For each record, there is a "name_first" field which is what I need the first two letters from.

There are three tables I am getting this information from: "men", "women" and "children".
There are other variables in the query: "online" and "categoy".

The query is currently:
$query_men = sprintf("SELECT * FROM men WHERE name_first LIKE '%s%%' AND online LIKE '%%Y%%' AND category LIKE '%%Men%%' ORDER BY name_first ASC", $colname_men);

Receive ? Instead Of Letters (using Greek)
I currently have an issue whera a client of mine setup a script to pull links for a MySQL database. In phpmyadmin, the letters show up fine, however, on the page they turn into ????? and I am not sure what to do about this. I've already consulted with others about this and could not find a solution.

The reason it has to be server side is because he tried the same script on another server, with different version php and mysql and it did work fine there.

Here is what the "non-working" server is running:

PHP 4.4.1
MySQL 4.1.14
charset UTF-8

The other server that works:

PHP 4.3.11
MySQL 3.23
not sure of charset as it is not our server.

Any ideas on this?

Order By Letters And Numbers
I have sporting league tables which have the divisions as 'P' (Premier), '1', '2' and '3'.

I have this code installed: ORDER BY division ASC, which puts 'P' at the bottom of the list. How can I put 'P' at the top? (then 1,2,3).

Search With Foreign Letters
I have a genalogy database And a php program for the user interface. Not sure if this goes here or in PHP formums, but this seemed a good place to start.I have names in the database that use the German ü which is fine, mysql will store the foreign letter (I just switch my keboard to German). But when my users query names, they won't be typing it with the umlaut, they'll probably just type a u without the umlaut so on a query the search comes up with nothing. I want people to search for u and still get the name displayed with the umlaut. Of course not all ancestors are German, so I want u to get a u too.Is there a simple way to do this, or am I going to have to put in some if statement that says if somewhere in the string is a ü, replace that string with ü = u. Seems a cumbersome way to do it.

Query Brings First Letters Of Entries Only
I've got a problem I don't really understand:

I have a form with a drop down meny (<select>) that gets it's alternatives from a database. When I press submit (and something in the form is missing so your still at the page of the form, only difference the empty fields are highlighted) the options in the drop down meny dissapears. I've done a print-out of the mysql-query results and found suprisingly that it contains of (notice that the combination of letters equals the first letters of the correct print-out):

Limiting The Number Of Letters Returned
I wrote some code to return the last 5 posts from my messageboard. I want to return only 25 characters per post. Here's my code:

Letters In Field Result In Error
I have a MYSQL problem I can't seem to figure out. It seems like something simple but alas I can not find the error.

I have a link which opens a new browser window. The link itself looks like this;

<a href="JavaScript:goVisitSite('http://www.website.com/view_product.php?iid=$row[0]')">View Product Page</a>

$row[0] being the item's ID.

The page it opens has this query;

$query = ("SELECT * FROM product WHERE product.id = {$_GET['iid']}");
$result = @mysql_query ($query);
$row = @mysql_fetch_array ($result,MYSQL_BOTH);

This code works fine for items with numerical values (123456) but does not load data for items with letters in the ID (E12345).

Sorting By A Column With Letters And Numbers
i have a column called `card_number` which the values inside are listed like "C1", "C2", "C3", etc etc...

the problem i have is when i do this
SELECT * FROM `cards` ORDER BY `card_number` ASC
.... it returns...
C1, C10, C11, C12, C2, C3, C4...

any way to make it do
C1, C2, C3, C4, ... C10, C11, C12....

??

Making An Array Of The First Letters In A Column
im trying to get an array of the 1st letters of a column in a table. i have a table that stores information about films and their directors. i want to know what letters are present in the table, i only want each letter once. example:

if i had this in my table

greg brant
james field
pete tongue
jeff kapes

i would get a result set like this

1: g
2: j
3: p

so im trying this

"SELECT DISTINCT SUBSTRING(director, 0, 1) AS letter FROM film_information"

where diorector is the column and film_information is the table. It doesnt seem to like the substring(). Can you use a column in the substring function?

How To Store Decimal With Letters And Then Display
I have a listing of items in a database and they have section numbers that are attached to these items. For example:

1.10 Item #1
1.20 Item #2
2.24 Item #3
11.00 Item #4

I currently have these stored as a decimal. Now I need to add letters onto some of these decimals.

1.10 Item #1
1.20 Item #2
2.24 Item #3
2.24n Item #5
11.00 Item #4

If I store the items as varchar they would sort like this.

1.10 Item #1
1.20 Item #2
11.00 Item #4
2.24 Item #3
2.24n Item #5

How can I store these section numbers and have a letter in with it and sort them in a numeric order?

Storing German Letters In Table Fields
i need to store some informations in german in one of my table.I am using Mysql5.0 .

How can i make this is possible. Currenltly the german letters showing as junk character.

Can I Make Mysql Auto-increment Letters?
Can Mysql auto-increment fields with letters? e.g. 1a -> 1b ...1z -> 2a....

Restore Db From 4.1.12 To 3.23
I've a backup from my database running on mysql 4.1.12

Now i want to restore this to an old machine running 3.23.

How to do this. I get several errors.

DB Restore
I appear to be getting the following error message everytime I want to restore this database. The message is as follows:

Unable to restore database web1_wordp : ERROR 1064 (42000) at line 754: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '22:17:15)' at line 1

I'm not quite sure what this means :confused: - How would I correct it?

Restore
A customer passed me her backup, for me to open in my MySql. They are 50Mb of backup. MySQLAdministrator is being long a lot, very even to make the restoration in my machine (1kbps!!!!)

Restore
I've got a table with over 400,000 records. I did a mysqldump to ensure I could restore it in case of problems. Sure enough, problems arose and I needed to do a restore. The mysqldump created the usual create database, create table and one gigantic insert statement, where all 400,000+ records are inserted. I started my restore around 10pm or so yesterday and was surprised to wake up this morning and find it still running. Considering the dump itself took a couple of seconds, why is the restore taking so long? I'm building a website that's going to have tons of traffic. A database restore that's going to take multiple hours seems to be unacceptable. One way to speed up the process would have been to simply copy the actual database files and just stick them back in the data directory.

How To Restore Database
I think i will have to da a full resortation of a database.

lets assume old database is deleted.

So I go to my hosting control panel and create a new mysql database
Use same username and password as used in original

open phpmyadmin and do to the new database and select import-then import the file that I have as a backup--i have a file that I exported as a text file-a full databse export. it is about 4 mb so I hope can do it at one time

Is that basically how I can do it??

Database Restore Help
im trying to construct a database using a backup file i made aout a year ago when i use phpmyadmin to upload the file i get an error on the first table it trys to create

CREATE TABLE `cal` (

`id` bigint( 20 ) NOT NULL AUTO_INCREMENT ,
`author` varchar( 32 ) NOT NULL default '',
`subj` varchar( 64 ) NOT NULL default '',
`txt` text NOT NULL ,
`typ` tinyint( 4 ) NOT NULL default &#390;',
`dmy` varchar( 8 ) NOT NULL default '',
`hm` varchar( 4 ) NOT NULL default '',
`wday` tinyint( 4 ) NOT NULL default &#390;',
`location` varchar( 64 ) NOT NULL default '',
`approved` char( 1 ) NOT NULL default '',
`tz` int( 11 ) NOT NULL default &#390;',
`dat` bigint( 20 ) NOT NULL default &#390;',
`mkt` bigint( 20 ) NOT NULL default &#390;',
PRIMARY KEY ( `id` ) ,
KEY `typ` ( `typ` ) ,
KEY `wday` ( `wday` ) ,
KEY `dmy` ( `dmy` ) ,
KEY `mkt` ( `mkt` )

) ENGINE = MYISAM DEFAULT CHARSET = latin1;

With this msg

MySQL said:

#1064 - You have an error in your SQL syntax near ') ENGINE=MyISAM DEFAULT CHARSET=latin1' at line 20

this was a backup straight from phpmyadmin some time ago, can someone tell me why it wont restore?

Mysql Restore
I have been running a mysql backend to phpBB on my home Gentoo based linux server. I recently switched the mysql and phpBB to run on a dedicated web server on my home network. I was using mysql version 4.1.14 and then 4.1.14-r1 on my new web server. The problem is that the character set seems to have gotten corrupted during the backup and restore process. The forum is based in French and hence a lot of the special characters have gotten messed up. I have even tried copying the my.cfg file from the old server to the new one but with no effect.

Stalled Restore
I Exported my MySQL database (60KB) (MySQL 4.0.24-standard) from iPowerweb hosting site.

I know want to restore it to my MySQL (mysql-4.1.13a-win32.zip) on my home server.

I loged on with MySQL Administrator, went to Restore, Opened .sql file, hit Start Restore, and it gets stuck at 9598 number of bytes each time I attempt it. Total is 60812 Bytes.

How To Restore A Database (.bak)
Recently I downloaded a ASP script, so I can use on my website, however in the instructions, it tells me the following : -

Restore the bbdf.bak SQL database with SQL 2005 (any edition) Management Tools

Now I have the file bbdf.bak, but I am not sure what I am suppose to do.

I have downloaded and installed Microsofts SQL 2005, but am totally lost as to what I am suppose to open and type .... ? ?

I would of thought it would be easier for them to just give me a .mdb file or something which I could use...

Restore Of Database
How do I go about restoring multiple databases at the same time. I know if I needed to restore 1 database I can do something like.

mysql db_name < backup-file.sql

but what if backup-file.sql consists of multiple databases (ie it was created using mysqldump-all-databases) , which database would I specify in the db_name section?

How To Restore .tgz Files?
how do I restore .tgz backup files using the mysql panel? I tried restoring it as a gunzipped file but it gave me errors.

SQL Database Restore
I upgraded to Tiger and it damaged my SQL database.

I have a backup file that is about 80 mb. The backup file was created
with PHPmyAdmin and is in .SQL format.

When I try to use PHPmyAdmin to load this .SQL file and restore my database, I get an error message that says NO SQL QUERY.

The file stops executing and NO data is restored.

Is this because the file is too big ??

Is there an application that will break the .SQL file down into smaller
parts ??

Is there a way to restore the data using the .SQL file and a direct SQL command line entry ??

Restore Problem
I am trying to do a Restore on a dump file (see below) but I get the "failed
copying a .frm file" error.

RESTORE TABLE ListMembers FROM
'/home/virtual/thefrugallife.com/var/www/html/12all/backups/1089048410_Mon05
-07-2004.sql';
+-------------+---------+----------+--------------------------+
| Table | Op | Msg_type | Msg_text |
+-------------+---------+----------+--------------------------+
| ListMembers | restore | error | Failed copying .frm file |
+-------------+---------+----------+--------------------------+
1 row in set (0.77 sec)

Backup / Restore
I have this one FreeBSD box (nice Dell with one 40GB HDD). I have made a replica of the drive and put it on the secondary IDE channel. I want to do a restore of all the MySQL db's to the second drive right after the backup takes place from the primary drive.

The reasoning behind this is that this is the only system running this particular app and the company that wrote it went belly so, I NEED to have the ability to just swap drives bring it back up and be done.

Backup/Restore
I'm migrating a web site from my testing system on my local machine to the web host upon which it will live. My testing server is running MySQL v. 5.0.22, and the remote host is running 4.0.24. I am using MySQL Administrator v. 1.0.10 to run a backup and export my tables to an SQL file, and PHPMyAdmin to import the SQL file and run it on the server. At first, I was getting a 1065 - Query is Empty error. After reading through some of the postings here, I realized that some of the commented strings at the top of the file were unnecessary, and probably the cause of my error, so I removed them. I re-ran a backup that would only backup the appropriate tables and write the appropriate data (the database schema on my server is named differently, so I don't need to back up the full path). After editing the file to remove the uneeded stuff, I recieve a different error message, regarding an error in the SQL syntax of the dump file. The error in question occurs on a line that reads as follows:

)ENGINE = MYIASM DEFAULT CHARSET = latin1;

The error in question is as follows:

#1064 - You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'DEFAULT CHARSET=latin1' at line 21

I'm having a hard time finding the issue, and would really appreciate if somebody might point me in the right direction to help me create a backup file that my server will interpret charitably and restore the data I need. I'm getting to the point where I may have to re-enter it all by hand, and that thought depresses me quite thoroughly.

Slow Restore
Mysql 4.1.15 on Win2k. Using InnoDB.

Using the mysql administrator gui to create a backup, everything goes
fine, and restores quickly.

Using the command line:

mysqldump %dbname% --single-transaction > %dbname%.sql

creates a file about 15% smaller than the gui produces, and is
EXTREMELY slow to restore. I have tried adding locks, skip opt,
everything. What does the gui use for a command to create this dump?

Backup/restore
Working on a single machine (win2k) needing to do backups. Trying Backup
Table with the following syntax:

BACKUP TABLE tbldealers TO 'c:mysqlackups'
BACKUP TABLE tbldealers TO /mysql/backups

I've tried with/without quotes, ticks, nothing except the path. I either
get error in syntax, or I do get 1 row in set, but there are no files in
that directory.

Any help would be appreciated.

I've read the manual as extensively as I know to and can't find anything on
backup table syntax.

I'd prefer to stay away from mysqldump and mysqlhotcopy and control the
backups myself.

Backup/restore
Working on a single machine (win2k) needing to do backups. Trying Backup
Table with the following syntax:

BACKUP TABLE tbldealers TO 'c:mysqlackups'
BACKUP TABLE tbldealers TO /mysql/backups

I've tried with/without quotes, ticks, nothing except the path. I either
get error in syntax, or I do get 1 row in set, but there are no files in
that directory.

Any help would be appreciated.

I've read the manual as extensively as I know to and can't find anything on
backup table syntax.

I'd prefer to stay away from mysqldump and mysqlhotcopy and control the
backups myself.

Backup And Restore
I have mysql 5 running as the db for my coldfusion application.  This particular application needs to make a copy of a certain db and restore it with a new name.  I have seen mysqlhotcopy but i need something that i can use from a cfquery tag in CF, can this be done?

Database Restore
How may I restore *.sql databases from linux shell?
I've read the use of mysql command I don't have installed.
This is a remote server with preinstalled Apache-php-mysql.

Restore Table
I am using mysql on my local machine, Windows operating system. I accidently execute an update statement without where condition, so I messed up all the records in this table, is there any solutions (or tricks) to restore data? I did not have any backup yet.

Restore Data
what is the difference between ?
1) mysql < backup_sunday_1_PM.sql
2) mysqlimport [options] db_name textfile1 [textfile2 ...]

3) Load data infile file

Restore Databases
Trying to restore some mysql databases that were on a hard drive which has crashed.
Although the DB's were supposed to be backed up ... it appears they were not backed up properly as I can access the drive but can only find the FRM files.
There are no MYI or MYD files on the old drive.
Is it still possible to restore my databases and tables with just the FRM files ??

Restore Query
I am restoring the backup I took from other server
so I ran
mysql tempo < file.sql

It runs fine for sometime and I can see the tables in the database tempo in mysql but it never stops and keeps on running
Is there anyways I can change the command to get output on console on the progress or anywhere I can read the logs which statement it is stuck in?

Backup / Restore
I have recently installed a Fedora server - something new to me. I am just trying to get my mysql database from my old windows server, onto my fedora box.I have tried, mysql_administrator to create backups and restore but it hasn't worked.I have also used the following two commands from root to do it:

mysqldump -u charlie -p -h 10.10.10.3 --all-databases > /test.sql
(to read from the windows server and create a dump on the local machine)

followed by:

mysql -u root -p < '/test.sql'
(to try and resore the backup to the fedora box)

I got the error:

ERROR 1054 (42S22) at line 6854: Unknown column 'cl.COMPONENT_ID' in 'field list'


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