Archive for November, 2007

MyISAM tables are used by default with MySQL. (Web design tools)

Wednesday, November 21st, 2007

MyISAM tables are used by default with MySQL. The tables are stored in the /var/lib/mysql/dbname directory by default, where dbname is replaced by the name of the database you are using. For each table, there are three files in this directory. Each file begins with the table name and ends with one of the following three suffixes: .frm Contains the definition (or form) or the table .MYI Contains the table’s index. .MYD Contains the table’s data. The following procedure describes how to use the myisamchk command to check your MyISAM tables. (The procedure is the same for checking ISAM tables, except that you use the isamchk command instead.) Note Do a backup of your database tables before running a repair with myisamchk. Though myisamchk is unlikely to damage your data, backups are still a good precaution. 1. Stop your MySQL server temporarily by typing the following from a Terminal window as the root user: # /etc/init.d/mysqld stop 2. You can check all or some of your database tables at once. The first example shows how to check a table called “names” in the “allusers” database. # myisamchk /var/lib/mysql/allusers/names.MYI Checking MyISAM file: /var/lib/mysql/allusers/names.MYI Data records: 5 Deleted blocks: 0 - check file-size - check key delete-chain - check record delete-chain - check index reference - check record links You could also check tables for all your databases at once as follows: # myisamchk /var/lib/mysql/*/*.MYI The example above shows a simple, 5-record database where no errors were encountered. If instead of the output shown above, you see output like the following you may need to repair the database: Checking MyISAM file: names.MYI Data records: 5 Deleted blocks: 0 - check file-size myisamchk: warning: Size of datafile is: 689 Should be: 204 - check key delete-chain - check record delete-chain - check index reference - check record links myisamchk: error: Found wrong record at 0 MyISAM-table ‘names.MYI’ is corrupted Fix it using switch “-r” or “-o” 3. To fix a corrupted database, you could run the following command # myisamchk -r /var/lib/allusers/names.MYI - recovering (with keycache) MyISAM-table ‘names.MYI’ Data records: 5
Looking for affordable and reliable webhost to host and run your business application? Then look no more and go to servlet web hosting services.

To see the privileges that you just granted, (Most popular web site)

Tuesday, November 20th, 2007

To see the privileges that you just granted, you can select mysql as your current database, they select the db table as follows: mysql> USE mysql; Database changed mysql> SELECT * FROM db WHERE db=”allusers”; +———+——–+——+————+————+————+———– |Host |Db |User |Select_priv |Insert_priv |Update_priv |Delete_priv +———+——–+——+————+————+————+———– |localhost|allusers|bobby | Y | Y | Y | Y +———+——–+——+————+————+————+———– The output here shows all users who are specifically granted privileges to the allusers database. Only part of the output is shown here because it is very long. You should either make a very wide terminal window to view the output or learn how to read wrapped text. Other privileges on the line will be set to N (no access). Revoking access You can revoke privileges you grant using the REVOKE command. To revoke all privileges for a user to a particular database, use the following procedure: 1. If you are not already connected to a mysql session, type the following command (assuming the mysql user name of root): # mysql -u root -p Enter password: ******* mysql> 2. To revoke all privileges of a user named bobby to use a database named allusers on your MySQL server, you could type the following: mysql> REVOKE ALL PRIVILEGES ON allusers.* -> FROM bobby@localhost; At this point, bobby has no privileges to use any of the tables in the allusers databases. 3. To see the privileges that you just granted, you can select mysql as your current database, they select the db table as follows: mysql> USE mysql; Database changed mysql> SELECT * FROM db WHERE db=”allusers”; The output should show that the user named bobby is no longer listed as having access to the allusers database. (The results might just say “Empty set.”) Checking and Fixing Databases Over time, databases can become corrupted or store information inefficiently. MySQL comes with commands that you can use to check and repair your databases. The myisamchk and isamchk commands are available to check MyISAM and ISAM database tables, respectively.
We recommend you use shared web hosting services, because many users agree that it is cheap, reliable and customer-satisfying webhost.

Web hosting top - Adding and Removing User Access There are several

Tuesday, November 20th, 2007

Adding and Removing User Access There are several different methods you can use to control user access to your MySQL databases. To begin with, assign a user name and password to every user that accesses your MySQL databases. Then you can use the GRANT and REVOKE commands of mysql to specifically indicate the databases and tables users and host computers can access, as well as the rights they have to those databases and tables. Cross-Reference Database servers are common targets of attacks from hackers. While this chapter gives some direction for granting access to your MySQL server, you need to provide much more stringent protection for the server if you are allowing Internet access. Refer to Section 6, The MySQL Access System in the MySQL manual (/usr/share/doc/mysql*/manual.html) for further information on securing your MySQL server. Adding users and granting access Though you have a user account defined to create databases (the root user, in this example), to make a database useful, you may want to allow access to other users as well. The following procedure describes how to grant privileges to your MySQL database for other users. Note If you are upgrading your MySQL from a version previous to 3.22, run the mysql_fix_privilege_tables script. This script adds new GRANT features to your databases. If you don’t run the script, you will be denied access to the databases. In this example, I am adding a user named bobby that can login to the MySQL server from the local host. The password for bobby is i8yer2shuz. (Remember that there does not have to be a Red Hat Linux user account named bobby. So any user on the localhost with the password for bobby can login to that MySQL account.) 1. If you are not already connected to a mysql session, type the following command (assuming the mysql user name of root): # mysql -u root -p Enter password: ******* mysql> 2. To create the user named bobby and a password i8yer2shuz, use the GRANT command as follows: mysql> GRANT USAGE ON *.* -> TO bobby@localhost IDENTIFIED BY “i8yer2shuz”; At this point, someone could login from the localhost using the name bobby and i8yer2shuz password (mysql -u bobby -p). But the user would have no privilege to work with any of the databases. Next you need to grant privileges. 3. To grant bobby privileges to work with the database called allusers, you could type the following: mysql> GRANT DELETE,INSERT,SELECT,UPDATE ON allusers.* -> TO bobby@localhost; In this example, the user named bobby is allowed to login to the MySQL server on the local host and access all tables from the allusers database (USE allusers). For that database, bobby will be able to use the DELETE, INSERT, SELECT, and UPDATE commands. 4.
Note: If you are looking for cheap and reliable webhost to host and run your mysql application check mysql web server services.

mysql> ALTER TABLE names ADD curdate TIMESTAMP; (Web hosting top) The

Monday, November 19th, 2007

mysql> ALTER TABLE names ADD curdate TIMESTAMP; The previous example tells mysql to change the table in the current database called names (ALTER TABLE names), add a column named curdate (ADD curdate), and assign the value of that column to display the current date (TIMESTAMP data type). If you decide later that you want to remove that column, you can remove it by typing the following: mysql> ALTER TABLE names DROP COLUMN curdate; If you want to change the name of an existing column, you can do so using the CHANGE option to ALTER. Here is an example: mysql> ALTER TABLE names CHANGE city town varchar(20); In the previous example, the names table is chosen (ALTER TABLE names) to change the name of the city column to town (CHANGE city town). The data type of the column must be entered as well (varchar(20)), even if you are not changing it. In fact, if you just want to change the data type of a column, you would use the same syntax as the previous example but you would simply repeat the column name twice. Here is an example: mysql> ALTER TABLE names CHANGE zipcode zipcode INTEGER; The previous example changes the data type of the zipcode column from its previous type (varchar) to the INTEGER type. Updating and deleting MySQL records You can select records based on any value you choose and update any values in those records. When you are in your mysql session, you can use UPDATE to change the values in a selected table. Here is an example: mysql> UPDATE names SET streetaddr = “933 3rd Avenue” WHERE firstname = “Chris”; Query OK, 1 row affected (0.00 sec) Rows matched: 1 Changed: 1 Warnings: 0 The previous example attempts to update the names table (UPDATE names). In this example, each record that has the firstname column set to “Chris” will have the value of the streetaddr column for that record changed to “933 3rd Avenue” instead. Note that the Query found 1 row that matched. That one row matched was also changed, with no error warnings necessary. You can use any combination of values to match records (using WHERE) and change column values (using SET) that you would like. After you have made a change, it is a good idea to display the results to make sure that the change was made as you expected. To remove an entire row (that is, one record), you can use the DELETE command. For example, if you wanted to delete any row where the value of the firstname column is “Chris”, you could type the following: mysql> DELETE FROM names WHERE firstname = “Chris”; Query OK, 1 row affected (0.00 sec) The next time you display the table, there will no longer be any records where the first name is Chris.
Searching for affordable and reliable webhost to host and run your web applications? Go to our java web server services and you will be pleased.

Web site developers - +————+———-+————+ Sorting data You can sort records based

Monday, November 19th, 2007

+————+———-+————+ Sorting data You can sort records based on the values in any column you choose. For example, using the ORDER BY operator, you can display the records based on the lastname column: mysql> SELECT * FROM names ORDER BY lastname; +————+———-+———————+————+——-+———+ | firstname | lastname | streetaddr | city | state | zipcode | +————+———-+———————+————+——-+———+ | John | Jones | 18 Talbot Road NW | Coventry | NJ | 54889 | | Howard | Manty | 1515 Broadway | New York | NY | 10028 | | Chris | Smith | 167 Small Road | Gig Harbor | WA | 98999 | +————+———-+———————+————+——-+———+ To sort records based on city name, you could use the following command: mysql> SELECT * FROM names ORDER BY city; +————+———-+———————+————+——-+———+ | firstname | lastname | streetaddr | city | state | zipcode | +————+———-+———————+————+——-+———+ | John | Jones | 18 Talbot Road NW | Coventry | NJ | 54889 | | Chris | Smith | 167 Small Road | Gig Harbor | WA | 98999 | | Howard | Manty | 1515 Broadway | New York | NY | 10028 | +————+———-+———————+————+——-+———+ Now that you have entered and displayed the database records, you may find that you need to change some of them. The following section describes how to update database records during a mysql session. Making Changes to Tables and Records As you begin to use your MySQL database, you will find that you need to make changes to both the structure and content of the database tables. The following section describes how you can alter the structure of your MySQL tables and change the content of MySQL records. If you are not already connected to a mysql session, type the following command (assuming the mysql user name of root): # mysql -u root -p Enter password: ******* mysql> To use the examples shown in the following sections, identify the database (allusers in this example) as the current database by typing the following: mysql> USE allusers; Database changed Altering MySQL tables After you have created your database tables, there will inevitably be changes you want to make to them. This section describes how to use the ALTER command during a mysql session to do the following: add a column, delete a column, rename a column, and change the data type for a column. To add a column to the end of your table that displays the current date, type the following:
Note: If you are looking for cheap and reliable webhost to host and run your mysql application check mysql web server services.

Web site - | firstname | lastname | streetaddr | city

Sunday, November 18th, 2007

| firstname | lastname | streetaddr | city | state | zipcode | +————+———-+———————+————+——-+———+ | John | Jones | 18 Talbot Road NW | Coventry | NJ | 54889 | +————+———-+———————+————+——-+———+ Using the OR operator, you can select records that match several different values. In the following command, records that have either Chris or Howard as the firstname are matched and displayed. mysql> SELECT * FROM names WHERE firstname = “Chris” OR firstname = “Howard”; +————+———-+———————+————+——-+———+ | firstname | lastname | streetaddr | city | state | zipcode | +————+———-+———————+————+——-+———+ | Chris | Smith | 175 Harrison Street | Gig Harbor | WA | 98999 | | Howard | Manty | 1515 Broadway | New York | NY | 10028 | +————+———-+———————+————+——-+———+ To match and display a record based on the value of two columns in a record, you can use the AND operator. In the following, command any record that has Chris as the firstname and Smith as the lastname is matched. mysql> SELECT * FROM names WHERE firstname = “Chris” AND lastname = “Smith”; +————+———-+———————+————+——-+———+ | firstname | lastname | streetaddr | city | state | zipcode | +————+———-+———————+————+——-+———+ | Chris | Smith | 175 Harrison Street | Gig Harbor | WA | 98999 | +————+———-+———————+————+——-+———+ Displaying selected columns You don’t need to display every column of data. Instead of using the asterisk (*) shown in previous examples to match all columns, you can enter a comma-separated list of column names. The following command displays the firstname, lastname, and zipcode records for all of the records in the “names” table: mysql> SELECT firstname,lastname,zipcode FROM names; +————+———-+———+ | firstname | lastname | zipcode | +————+———-+———+ | Chris | Smith | 98999 | | John | Jones | 54889 | | Howard | Manty | 10028 | +————+———-+———+ Likewise, you can sort columns in any order you choose. Type the following command to show the same three columns with the zipcode column displayed first: mysql> SELECT zipcode,firstname,lastname FROM names; +———+————+———-+ | zipcode | firstname | lastname | +———+————+———-+ | 98999 | Chris | Smith | | 54889 | John | Jones | | 10028 | Howard | Manty | +———+————+———-+ Note that you can have the columns displayed in any order you choose. You can also mix column selection with record selection as shown in the following example: mysql> SELECT firstname,lastname,city FROM names WHERE firstname = “Chris”; +————+———-+————+ | firstname | lastname | city | +————+———-+————+ | Chris | Smith | Gig Harbor |
In case you need affordable webhost to host your website, our recommendation is ecommerce web host services.

Web hosting account - SET(’val1′,’val2′,…) Contains a set of values. A SET

Sunday, November 18th, 2007

SET(’val1′,’val2′,…) Contains a set of values. A SET column can display zero or more values from the list of values contained in the SET column definition. Up to 64 members are allowed. Uses 1, 2, 3, 4 or 8 bytes, varying based on how many of the up to 64 set members are used. TEXT Same as BLOB, except that searching is done on these columns in case-insensitive style. Uses up to L+2 bytes, where L is less than or equal to 65535 TINYBLOB Contains a binary large object (BLOB) that varies in size, based on the actual value of the data, rather than on the maximum allowable size. TINYBLOB allows smaller values than BLOB. Searches on a TINYBLOB column are case-sensitive. Uses up to L+1 bytes, where L is less than or equal to 255 TINYTEXT Same as TINYBLOB, except that searching is done on these columns in case-insensitive style. Uses up to L+1 bytes, where L is less than or equal to 255 [NATIONAL] VARCHAR(M) [BINARY] Contains a character string of variable length, with no padded spaces added. The value of (M) determines the number of characters (from 1 to 255). If the BINARY keyword is used, sorting of values is case-sensitive (it is case-insensitive by default). The NATIONAL keyword indicates that the default CHARACTER set should be used. Uses L+1 bytes, where L is less than or equal to M and M is from 1 to 255 characters Displaying MySQL Databases There are many different ways of sorting and displaying database records during a mysql session. If you are not already connected to a mysql session, type the following command (assuming the mysql user name of root): # mysql -u root -p Enter password: ******* mysql> When you are in your mysql session (and have chosen your database), you can display all or selected records from a table, choose which columns are displayed, or choose how displayed records are sorted. Displaying all or selected records Assuming that the current database is allusers (as shown in the previous examples), type the following command to choose (SELECT) all records (*) from the “names” table and display them in the order in which they were entered into the database. mysql> SELECT * FROM names; +————+———-+———————+————+——-+———+ | firstname | lastname | streetaddr | city | state | zipcode | +————+———-+———————+————+——-+———+ | Chris | Smith | 175 Harrison Street | Gig Harbor | WA | 98999 | | John | Jones | 18 Talbot Road NW | Coventry | NJ | 54889 | | Howard | Manty | 1515 Broadway | New York | NY | 10028 | +————+———-+———————+————+——-+———+ The following command displays all records from the “names” table that have the lastname column set to Jones. Instead of using lastname, you could search for a value from any column name used in the table. mysql> SELECT * FROM names WHERE lastname = “Jones”; +————+———-+———————+————+——-+———+
We recommend cheap and reliable webhost to host and run your web applications: Coldfusion Web Hosting services.

Fedora web server - Contains a time between -838:59:59 and 838:59:59. The

Saturday, November 17th, 2007

Contains a time between -838:59:59 and 838:59:59. The format of the field is in hours, minutes, and seconds (HH:MM:SS). YEAR[(2|4)] Contains a year, represented by either two or four Uses 1 byte digits. For a four-digit year, YEAR can be between 1901 to 2155 (0000 is also allowed). For a two-digit year, the digits 70-69 can represent the years from 1970-2069. Table 24-4: String Data Types for Columns Data Type Description Space Needed BLOB Contains a binary large object (BLOB) that varies in size, based on the actual value of the data, rather than on the maximum allowable size. Searches on a BLOB column are case-sensitive. Uses up to L+2 bytes, where L is less than or equal to 65535 [NATIONAL] CHAR(M) [BINARY] Contains a character string of fixed length, with spaces padded to the right to meet the length. To display the value, the spaces are deleted. The value of (M) determines the number of characters (from 1 to 255). If the BINARY keyword is used, sorting of values is case-sensitive (it is case-insensitive by default). The NATIONAL keyword indicates that the default CHARACTER set should be used. Uses between 1 and 255 bytes, based on the value of (M) ENUM(’val1′,’val2′,…) Contains enumerated strings that are typically chosen from a list of values indicated when you create the column. For example, you set a column definition to ENUM(”dog”,”cat”,”mouse”). Then, if you set the value of that column to “1″ the value displayed would be “dog”, “2″ would be “cat” and “3″ would be mouse. It lets you take a number as input and have a string as output. Up to 65535 values are allowed. Uses either 1 byte (for up to about 255 values) or 2 bytes, (for up to 65535 values) LONGBLOB Contains a binary large object (BLOB) that varies in size, based on the actual value of the data, rather than on the maximum allowable size. LONGBLOB allows larger values than MEDIUMBLOB. Searches on a LONGBLOB column are case-sensitive. Uses up to L+4 bytes, where L is less than or equal to 4294967295 LONGTEXT Same as LONGBLOB, except that searching is done on these columns in case-insensitive style. Uses up to L+4 bytes, where L is less than or equal to 4294967295 MEDIUMBLOB Contains a binary large object (BLOB) that varies in size, based on the actual value of the data, rather than on the maximum allowable size. MEDIUMBLOB allows larger values than BLOB. Searches on a MEDIUMBLOB column are case-sensitive. Uses up to L+3 bytes, where L is less than or equal to 16777215 MEDIUMTEXT Same as MEDIUMBLOB, except that searching is done on these columns in case-insensitive style. Uses up to L+3 bytes, where L is less than or equal to 16777215
We recommend high quality webhost to host and run your jsp application: christian web host services.

Anonymous web server - 53. The display size and number of decimals

Friday, November 16th, 2007

53. The display size and number of decimals are undefined. FLOAT[(M,D)] [ZEROFILL] Contains a single-precision floating-point number. Values that are allowed include: -3.402823466E+38 to -1.175494351E-38 0 1.175494351E-38 to 3.402823466E+38. If the display value (M) is less than or equal to 24, the number is a single-precision floating-point number. Uses 4 bytes if X is less than or equal to 24 Uses 8 bytes if X is greater than or equal to 25 and less than or equal to 53 INT[(M)] [UNSIGNED] [ZEROFILL] Contains an integer of normal size. The range is -2147483648 to 2147483647 if it’s signed and 0 to 4294967295 if unsigned. Uses 4 bytes INTEGER[(M)] [UNSIGNED] [ZEROFILL] Same as INT. Same as INT MEDIUMINT[(M)] [UNSIGNED] [ZEROFILL] Contains an integer of medium size. The range is -8388608 to 8388607 if it’s signed and 0 to 16777215 if unsigned. Uses 3 bytes NUMERIC(M,D) [ZEROFILL] Same as DECIMAL. Same as DECIMAL REAL Same as DOUBLE. Same as DOUBLE. SMALLINT[(M)] [UNSIGNED] [ZEROFILL] Contains an integer of small size. The range is -32768 to 32767 if it’s signed and 0 to 65535 if it’s unsigned. Uses 2 bytes TINYINT[(M)] [UNSIGNED] [ZEROFILL] A very small integer, with a signed range of -128 to 127 and a 0 to 255 unsigned range. Uses 1 byte The format of dates in MySQL is YYYY-MM-DD, which stands for the year, month and day. Any improperly formatted date or time values will be converted to zeroes. Table 24-3: Time/Date Data Types for Columns Data Type Description Space Needed DATE Contains a date between the range of January 1, 1000 (1000-01-01) and December 31, 9999 (9999-12-31). Uses 3 bytes DATETIME Contains a combination of date and time between zero hour of January 1, 1000 (1000-01-01 00:00:00) and the last second of December 31, 9999 (9999-12-31 23:59:59). Uses 8 bytes TIMESTAMP[(M)] Contains a timestamp from between zero hour of January 1, 1970 (1970-01-01 00:00:00) and a time in the year 2037. It is stored in the form: YYYYMMDDHHMMSS. Using (M), you can reduce the size of the TIMESTAMP displayed to less than the full 14 characters (though the full 4-byte TIMESTAMP is still stored). Uses 4 bytes TIME Uses 3 bytes
From our experience, we are can tell you that you can find a reliable and cheap webhost service at Java Web Hosting services.

There can be up to 30 of digits (Web server type)

Friday, November 16th, 2007

There can be up to 30 of digits following the decimal point for floating-point data types. A “D” option to a data type indicates the number of digits allowed for a floating-point number following the decimal point. (The value should be no more than two digits less than the value of the display size being used.) The UNSIGNED option (shown in braces) indicates that only positive number to be allowed in the column. This allows the column to hold larger positive numbers. The ZEROFILL option (shown in braces) indicates that the data in the column will be padded with zeros. For example, the number 25 in a column with a data type of INTEGER(7) ZEROFILL would appear as 0000025. (Any ZEROFILL column automatically becomes UNSIGNED.) All values shown in braces are optional. The parentheses shown around the (M) and (D) values are necessary if you enter either of those values. In other words, don’t type the braces, but do type the parentheses. Table 24-2: Numeric Data Types for Columns Data Type Description Space Needed BIGINT[(M)] [UNSIGNED] [ZEROFILL] Can contain large integers with the following allowable values: -9223372036854775808 to 9223372036854775807 (unsigned) 0 to 18446744073709551615 (signed) Uses 8 bytes DECIMAL[(M[,D])] [ZEROFILL] Contains an unpacked floating-point number (signed only). Each digit is stored as a single character. When you choose the display value (M), decimal points and minus signs are not counted in that value. The value of (M) is 10 by default. Setting D to zero (which is the default) causes only whole numbers to be used. Uses M+2 bytes if D is greater than 0 Uses M+1 bytes if D is equal to 0 DOUBLE[(M,D)] [ZEROFILL] Contains a double-precision, floating-point number of an average size. Values that are allowed include: -1.7976931348623157E+308 to -2.2250738585072014E-308 0 2.2250738585072014E-308 to 1.7976931348623157E+308. Uses 8 bytes DOUBLE PRECISION Same as DOUBLE. Same as DOUBLE. FLOAT(X) [ZEROFILL] Contains a floating-point number. For a single-precision floating-point number X can be less than or equal to 24. For a double-precision floating-point number, X can be between 25 and Uses 4 bytes
We would like to recommend you tested and proved virtual web hosting services, which you will surely find to be of great quality.