Security on MySQL tables for MyISAM

Hello friends,
Question 1 :
I have installed MySQL version 4.0.3 beta on Windows 2000 machine with PIV, 128 MB RD RAM.
I've created two databases say A and B and then created Tables a1,a2,a3 in database A and b1,b2,b3,b4,b5 in database B (All these table types are of MyISAM).... Now if simply i copy all the files residing in database A to database B removing ... i can easily see all the tables that were in A.
HOw to prevent this?? if u know any of the solution.. do write me at the earliest...??
Question 2:
Is it possible with mysql to have a user which is allowed to start Only the Server (NO Other Permissions ..i.e. read, write user tables etc)... i'll create other users for accessing the database ....??
Thanx in advance,
Ketan
\\|||//
( o o )
\ 0 /
-----------------o00o--------o00o----------------------
There are 10 kinds of people in the World, One Who
understands binary, Other Who don't...
- from a Forum Post
---------------------o00o--------o00o------------------

>
HOw to prevent this?? if u know any of the
e solution.. do write me at the earliest...??
Not sure if I understand the question. But if I do, the answer has nothing to do with java.
The database you are using allows you to create users with rights to do things. You create the users such they can not do things that they shouldn't.
"How" you do this is explained in SQL Server documentation.
There is absolutely no way to prevent this if the user has all access rights - such as a DBA. Then it is not a programming issue, it is a management issue.
>
Question 2:
Is it possible with mysql to have a user which is
s allowed to start Only the Server (NO Other
Permissions ..i.e. read, write user tables etc)...
i'll create other users for accessing the database
....??No. And Yes.
If you set the server up to validate using Windows users rather than SQL Server users then you assign permissions based on the windows user. So only those users with rights in database can do anything.
However, setting up SQL Server to do users via Windows is seldom, if ever, a good idea. The two are simply two different domains.
It is common practice to have sys admins start and stop production databases. But only the DBAs have access to the database itself. Just like sys admins can usually log in to any (or most) computers, but they don't log in as the user of the computer, but rather as an adminstrator or as themselves.
The above is not really part of SQL Server. It is part of the management practice for running a business (and the knowledge of how to set rights for users in databases and operating systems.)

Similar Messages

  • Querying CMS tables for users' security, history & favorites

    Hello,
    We are running BOBJ over a BW environment, and we've been asked to help design a Webdynpro interface that reads a user's security credentials in both BW and BOBJ servers and pulls in all reports, Bex or BOBJ, that they have access to.
    To do this, we would need to query the CMS tables for:
    All reports a user is authorized to view
    Groups a user is associated with
    User's History
    User's Favorites
    Does anyone have suggestions?  I've researched Query Builder, but I'm not sure if it can help us, as it accesses three virtual tables instead of the physical tables in the CMS.  The option I am guessing we will need to use is SDK. 
    I'm fairly new to both BW and BOBJ, so any advice is appreciated.
    Thanks
    Scott

    Hello Scott,
    Did you check the possibility of using Audit universe and reports? Please check below link for some useful sample files.
    http://scn.sap.com/docs/DOC-53904
    Regards,
    Nikhil Joy

  • RegEX for a valid mysql table name

    Hi all,
    i'm trying to figure out a regular expression for a mysql table so i can check if the string is a valid mysql table name.
    I don't know exactly the valid characters for a mysql table name.
    does any one have an Idea ?
    thnx

    You win the deal i don't know the characters :)
    Now come on. You know what DB you're using. Just google for some dox. Can't be that difficult.
    So what is the exception raised by mysql engine if
    not a valid name ?Depends on your DB and/or the JDBC implementation.
    >
    how can i catch it to prompt the user with a proper
    error message?I suppose by catching any exception risen when calling executeQuery() or the like and outputting its message.

  • HS connection to MySQL fails for large table

    Hello,
    I have set up an HS to a MySql 3.51 dabatabe using an ODBC DNS. My Oracle box has version 10.2.0.1 running in Windows 2003 R2. MySQL version is 4.1.22 running on a different machine with the same OS.
    I completed the connection through a database link, which works fine in SQLPLUS when selecting small MySQL Tables. However, I keep getting an out of memory error when selecting certain large table from the MySQL database. Previously, I had tested the DNS and ran the same SELECT in Access and it doesn't give any error. This is the error thrown by SQLPLUS:
    SQL> select * from progressnotes@mysql_rmg where "encounterID" = 224720;
    select * from progressnotes@mysql_rmg where "encounterID" = 224720
    ERROR at line 1:
    ORA-00942: table or view does not exist
    [Generic Connectivity Using ODBC][MySQL][ODBC 3.51
        Driver][mysqld-4.1.22-community-nt]Lost connection to MySQL server during query
    (SQL State: S1T00; SQL Code: 2013)
    ORA-02063: preceding 2 lines from MYSQL_RMG
    I traced the HS connection and here is the result from the .trc file:
    Oracle Corporation --- THURSDAY JUN 12 2008 11:19:51.809
    Heterogeneous Agent Release
    10.2.0.1.0
    (0) [Generic Connectivity Using ODBC] version: 4.6.1.0.0070
    (0) connect string is: defTdpName=MYSQL_RMG;SYNTAX=(ORACLE8_HOA, BASED_ON=ORACLE8,
    (0) IDENTIFIER_QUOTE_CHAR="",
    (0) CASE_SENSITIVE=CASE_SENSITIVE_QUOTE);BINDING=<navobj><binding><datasources><da-
    (0) tasource name='MYSQL_RMG' type='ODBC'
    (0) connect='MYSQL_RMG'><driverProperties/></datasource></datasources><remoteMachi-
    (0) nes/><environment><optimizer noFlattener='true'/><misc year2000Policy='-1'
    (0) consumerApi='1' sessionBehavior='4'/><queryProcessor parserDepth='2000'
    (0) tokenSize='1000' noInsertParameterization='true'
    noThreadedReadAhead='true'
    (0) noCommandReuse='true'/></environment></binding></navobj>
    (0) ORACLE GENERIC GATEWAY Log File Started at 2008-06-12T11:19:51
    (0) hoadtab(26); Entered.
    (0) Table 1 - PROGRESSNOTES
    (0) [MySQL][ODBC 3.51 Driver][mysqld-4.1.22-community-nt]MySQL client ran out of
    (0) memory (SQL State: S1T00; SQL Code: 2008)
    (0) (Last message occurred 2 times)
    (0)
    (0) hoapars(15); Entered.
    (0) Sql Text is:
    (0) SELECT * FROM "PROGRESSNOTES"
    (0) [MySQL][ODBC 3.51 Driver][mysqld-4.1.22-community-nt]Lost connection to MySQL
    (0) server during query (SQL State: S1T00; SQL Code: 2013)
    (0) (Last message occurred 2 times)
    (0)
    (0) [A00D] Failed to open table MYSQL_RMG:PROGRESSNOTES
    (0)
    (0) [MySQL][ODBC 3.51 Driver]MySQL server has gone away (SQL State: S1T00; SQL
    (0) Code: 2006)
    (0) (Last message occurred 2 times)
    (0)
    (0) [MySQL][ODBC 3.51 Driver]MySQL server has gone away (SQL State: S1T00; SQL
    (0) Code: 2006)
    (0) (Last message occurred 2 times)
    (0)
    (0) [S1000] [9013]General error in nvITrans_Commit - rc = -1. Please refer to the
    (0) log file for details.
    (0) [MySQL][ODBC 3.51 Driver]MySQL server has gone away (SQL State: S1T00; SQL
    (0) Code: 2006)
    (0) (Last message occurred 2 times)
    (0)
    (0) [S1000] [9013]General error in nvITrans_Rollback - rc = -1. Please refer to
    (0) the log file for details.
    (0) Closing log file at THU JUN 12 11:20:38 2008.
    I have read the MySQL documentation and apparently there's a "Don't Cache Result (forward only cursors)" parameter in the ODBC DNS that needs to be checked in order to cache the results in the MySQL server side instead of the Driver side, but checking that parameter doesn't work for the HS connection. Instead, the SQLPLUS session throws the following message when selecting the same large table:
    SQL> select * from progressnotes@mysql_rmg where "encounterID" = 224720;
    select * from progressnotes@mysql_rmg where "encounterID" = 224720
    ERROR at line 1:
    ORA-02068: following severe error from MYSQL_RMG
    ORA-28511: lost RPC connection to heterogeneous remote agent using
    SID=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=10.0.0.120)(PORT=1521))(CONNECT_DATA=(SID=MYSQL_RMG)))
    Curiously enough, after checking the parameter, the Access connection through the DNS ODBS seems to improve!
    Is there an aditional parameter that needs to be set up in the inithsodbc.ora perhaps? These are current HS paramters:
    # HS init parameters
    HS_FDS_CONNECT_INFO = MYSQL_RMG
    HS_FDS_TRACE_LEVEL = ON
    My SID_LIST_LISTENER entry is:
    (SID_DESC =
    (PROGRAM = HSODBC)
    (SID_NAME = MYSQL_RMG)
    (ORACLE_HOME = D:\oracle\product\10.2.0\db_1)
    Finally, here is my TNSNAMES.ORA entry for the HS connection:
    MYSQL_RMG =
    (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 10.0.0.120)(PORT = 1521))
    (CONNECT_DATA =
    (SID = MYSQL_RMG)
    (HS = OK)
    Your advice will be greatly appeciated,
    Thanks,
    Luis
    Message was edited by:
    lmconsite

    First of all please be aware HSODBC V10 has been desupported and DG4ODBC should be used instead.
    The root cause the problem you describe could be related to a timeout of the ODBC driver (especially while taking care of the comment: it happens only for larger tables):
    (0) [MySQL][ODBC 3.51 Driver]MySQL server has gone away (SQL State: S1T00; SQL
    (0) Code: 2006)
    indicates the Driver or the DB abends the connection due to a timeout.
    Check out the wait_timeout mysql variable on the server and increase it.

  • Display mysql table data in a jsf page? (10 duke dollars up for grabs)

    hi,
    im having some trouble on how to display data from a mysql table in a JSF page under the JSF architecture. i need some help on the best and correct way of doing this?
    if you could provide code on how this is done, would be much appreciated.
    many thanks.

    I'm going to assume that you have had experience with doing this in jsp. Watch for my comments by the **** asterisks *****. My skill level is best described as intermediate, so you'll probably want to heed replies from the more accomplished members of the community to improve upon this advice.
    The jsp page:
    <%@ page language="java" %>
    <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
    <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
    <%@ taglib uri="http://myfaces.apache.org/extensions" prefix="x" %>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    ***** All of your jsf content must be between the f:view tags ******
    <f:view>
    <html lang="en-US" xml:lang="en-US">
    <head>
    <title>Page Title</title>
    </head>
    <body>
    ***** Here is the h:form tag which constructs the appropriate html form tag.
    ***** You don't need to worry about get/post and all that.
    <h:form>
    ***** The h:panelGrid constructs a table that I'm using purely for layout purposes *****
    <h:panelGrid width="800" columnClasses="textColumns">
    ***** the h:dataTable is doing the heavy lifting here. the var attribute is the name you
                   want to give to the data you're returning. The value
                   attribute it bound to a managed bean named MemberList in my faces-config and all refers
                   to a method named getAll (in bean style) that returns a java.sql.Result.
              ***** You can see below how the columns are laid out with the h:column tags and how the header for
                             the columns are named.
              ***** The dataTable iterates over each value in the outputText tags contained in the column tags.
                             It's bound by the var_name.query_field_name. The field name is the one bundled in your result
              ***** Scroll down to see the MemberList bean code.
    <h:dataTable var="foo" value="#{MemberList.all}">
    <h:column>
    <f:facet name="header">
    <h:outputText value="Name"/>
    </f:facet>
    <h:outputText value="#{foo.name}"/>
    </h:column>
    <h:column>
    <f:facet name="header">
    <h:outputText value="bar Number"/>
    </f:facet>
    <h:outputText value="#{foo.ANET_NUM}"/>
    </h:column>
    <h:column>
    <f:facet name="header">
    <h:outputText value="Group"/>
    </f:facet>
    <h:outputText value="#{foo.CUST_GROUP}"/>
    </h:column>
    <h:column>
    <f:facet name="header">
    <h:outputText value="Classification"/>
    </f:facet>
    <h:outputText value="#{foo.CLASSIFICATION}"/>
    </h:column>
    <h:column>
    <f:facet name="header">
    <h:outputText value="Sector"/>
    </f:facet>
    <h:outputText value="#{foo.SECTOR}"/>
    </h:column>
    <h:column>
    <f:facet name="header">
    <h:outputText value="Address"/>
    </f:facet>
    <h:outputText value="#{foo.ADDRESS1}"/><f:verbatim><br></f:verbatim>
    <h:outputText escape="false" value="#{MemberList.ADDRESS2} <br>"
    rendered="#{MemberList.ADDRESS2 != null}"/>
    <h:outputText value="#{foo.CITY}"/><f:verbatim>, </f:verbatim>
    <h:outputText value="#{foo.STATE}"/><f:verbatim>, </f:verbatim>
    <h:outputText value="#{foo.ZIP}"/>
    </h:column>
    <h:column>
    <f:facet name="header">
    <h:outputText value="Purchasing Contact"/>
    </f:facet>
    <h:outputText value="#{foo.CONTACT}"/>
    </h:column>
    <h:column>
    <f:facet name="header">
    <h:outputText value="Purchasing Phone"/>
    </f:facet>
    <h:outputText value="#{foo.WORK}"/>
    </h:column>
    </h:dataTable>
    </h:panelGrid>
    </h:form>
    </body>
    </html>
    </f:view>
    *** MemberList bean code:
    package bar.vendor;
    import bar.dbConnectionInfo;
    import javax.faces.context.ExternalContext;
    import javax.faces.context.FacesContext;
    import javax.naming.NamingException;
    import javax.servlet.http.HttpSession;
    import javax.servlet.jsp.jstl.sql.Result;
    import javax.servlet.jsp.jstl.sql.ResultSupport;
    import java.sql.*;
    public class MemberList extends dbConnectionInfo {
    private Connection conn;
    public void open() throws SQLException, NamingException {
    ******* Here is where I set up my connection info. I store it in a separate class.
    ******* You'll set yours up according to your MySQL settings.
    conn = DriverManager.getConnection(getUrl(), getUsername(), getPassword());
              ******* The rest of this is pretty standard. The only exceptions is where I use the FacesContext
              ******* to get the session and getting a parameter map (see below)
    public Result getAll() throws SQLException, NamingException {
    FacesContext facesContext = FacesContext.getCurrentInstance();
    ExternalContext extContext = facesContext.getExternalContext();
    HttpSession session = (HttpSession) extContext.getSession(true);
    ResultSet rs = null;
    String schema = getOracleOwner();
    String sql = "select distinct c.name, c. ANet_Num, ug.cust_group, ug.classification, c.sector, " +
    " a.address1, a.address2, a.city, a.state, a.zip," +
    " trim(cc.fname) || ' ' || trim(cc.lname) as Purchasing_Contact, cc.work " +
    " from "+schema+".cust c, "+schema+".vw_unique_cust_address u, "+schema+".cust_address a, " +
    " "+schema+".cust_group cg, "+schema+".vw_purchasing_contact pc, "+schema+".cust_contact cc, " +
    " "+schema+".baruser nu, "+schema+".dist_contact dc, "+schema+".contract con, " +
    " "+schema+".contract_access ca, "+schema+".vw_unique_cust_groups ug " +
    " where nu.id = ? " +
    " and c.SECTOR = ? " +
    " and nu.fk_dist_contact_id = dc.id " +
    " and dc.fk_dist_id = con.fk_dist_id " +
    " and con.id = ca.fk_contract_id " +
    " and ca.fk_group_type_id = cg.fk_group_type_id " +
    " and cg.fk_cust_id = c.id " +
    " and c.id = u.id " +
    " and to_number(substr(u.desc_type,2)) = a.id(+) " +
    " and c.id = pc.id(+) " +
    " and pc.cc_id = cc.id(+) " +
    " and c.status = 'Active' " +
    " and c.id = ug.id " +
    " order by ug.cust_group, c.name";
    try {
    open();
    PreparedStatement ps = conn.prepareStatement(sql);
    ps.setString(1, (String) session.getAttribute("baruserID"));
    **** This is cool. Look at the f:param tag as it pertains to commandButtons and commandLinks *****
    ps.setString(2,(String) FacesContext.getCurrentInstance().getExternalContext().getRequestParameterMap().get("sector"));
    rs = ps.executeQuery();
    } catch (SQLException sqle) {
    System.out.println(sqle.getMessage());
    } catch (Exception e){
    System.out.println(e.getMessage());
    //close();
    return ResultSupport.toResult(rs);
    public void close() throws SQLException {
    if (conn == null) return;
    conn.close();
    conn = null;
    }

  • Need help for "From concatenate string insert to mysql table"

    Well, most of this problem is a question about SQL syntax. In the VALUES clause you put a comma delimited list of the values to go into the new record. You insert one record at a time. How are the columns defined? Have you done any study on basic SQL?
    Mike...

    i nid to insert values from concatenate string into mysql with using LabSQL, but the result come out from conatenate string is like " 2015-07-08 00:00:00 38.933235E-3" , a logged data of "Date Time Wind Speed(m/s). i nid to put these 3 values into 3 different column in mysql which is Date Time and Wind Speed. How can i pick Date to put inside Date's column, Time into Time's column and Wind Speed into Wind Speed's column in mysql ?
    What i do is
    INSERT INTO wind_speed_data (Date, Time, Wind_Speed) The space in Wind Speed can i put a _ in between Wind Speed? without _ and just put Wind Speed it shows errors.
    VALUES( i have no idea wat to key in at this part ) <--- nid help !
    The Mysql table. Date Time Wind Speed
    The result from concatenate string. Have to insert into mysql.
    My labview program.
    The error i facing.
     

  • Inserting Into MYSQL Table Via Air/PHP = Not Allowed?

    I'm having trouble inserting data into my mysql database tables through my air app. All the code is pretty much exactly the same as in some examples I've seen but it simply won't do it. Is this because of some sort of security restriction because the air app is on my machine and the server with my mysql database on is elsehwhere? Or is it possible to insert data via an air app?
    Here is the example I've been following:-
    http://livedocs.adobe.com/flex/3/html/help.html?content=data_access_2.html

    jimmyoneshot wrote:
    Thanks for the answers boys. I've decided I'm going to change it into a flex app instead as then there won't be any problems. It simply means I'll have to add a logon system to it.
    While were on the subject do you guys happen to know of any examples anywhere of how someone can REMOVE data from an sql table via flex/php?
    What I'm looking for is basically when a user uses my app and enters info into some text inputs, if that specfic info exists within a table then that data will be removed from the table. The way this works is that they will choose an item within a tilelist which is populated by the data from this mysql table and this will insert the data of the selected item into the text inputs and then they click a remove button to remove that item. Can't find anything similar anywhere though.
    You will have to use a common identifier, eg:
    give each row in your database an ID.
    then pass that ID value on the button press to a PHP script, which does something like:
    $deleteID = $_POST["delID"];
    mysql_query("DELETE FROM exampleTable WHERE ID='$deleteID
    maybe check that a row with that ID exists first for verification, then pass back a value indicating if removal was a success or not.
    You can delete on other values, but remember they have to be unique for the database, else you'll run the risk of deleting multiple values.
    Or you could delete on a compound key, depends on the data you're storing in the grid.

  • How can i access a mysql table without putting the data in a datagrid

    I developed my air app with a datagrid which uses a php service to display all data from a table of strings in MySql.
    I now do not need the datagrid, how can i get the data from my database without putting it into a dataGrid? Do i need an array? how do i do this? anyone got any example code?

    Balakrishnan V wrote:
    var resultArrayCollection:ArrayCollection=new ArrayCollection()
    protected function resultHandler(event:ResultEvent)
         result=event.result as ArrayCollection
    You can use the result array collection now inside your program for any further changes / manipulations.
    Hope this helps; If you have further doubts, do ask...
    Balakrishnan V
    Hi, yeah this helps,
    however, how would i generate a result handler for a service that has not been called yet? Sorry my knowledge of services is very limited.
    This is a php service, get_all service that returns all the rows from a mysql table.
    I can see the service box with the service i want to use:
    but how do i pass that to a result handler?

  • Problem in inserting data into MySQL table

    Hi All,
    I have a table with just two fields FIRSTNAME and SECONDNAME in MySQL. I am accepting the First Name and Second Name in two text fields and then trying to insert them into the MySQL table. I have set the concurrency of the rowset to CONCUR_UPDATABLE and am using the code clip for Database row insert with the appropriate changes. When I run the application it doesnt give me any errors but the data is also not inserted in the table. Can someone pls help me out.
    Loneliness wins the race :-)

    This is my problem when inserting single row. What does it means ?
    MusicInsert: com.mysql.jdbc.NotUpdatable: Result Set not updatable.This result set must come from a statement that was created with a result set type of ResultSet.CONCUR_UPDATABLE, the query must select only one table, and must select all primary keys from that table. See the JDBC 2.1 API Specification, section 5.6 for more details

  • Exporting a MySQL table to Excel

    My users have asked for the ability to download a MySQL table to an Excel spreadsheet. Being an amateur at all this PHP stuff I googled around and found a script that is supposed to do this. It's failing with "Couldn't select database: Access denied for user 'holli10_tonybabb'@'%' to database '_admin' 1044"
    It seems to be picking up an extra "@%" from somewhere
    I used the same settings that I successfully used for a CRON backup job.. I'd really appreciate any insight you can suggest. The script is shown below,
    Thanks
    Tony
    <?php
    //EDIT YOUR MySQL Connection Info:
    $DB_Server = "209.200.244.80";  //your MySQL Server
    $DB_Username = "holli10_tonybabb";     //your MySQL User Name
    $DB_Password = "abcd1234";    //your MySQL Password
    $DB_DBName = "_admin";    //your MySQL Database Name
    $DB_TBLName = "volunteers";    //your MySQL Table Name
    //$DB_TBLName,  $DB_DBName, may also be commented out & passed to the browser
    //as parameters in a query string, so that this code may be easily reused for
    //any MySQL table or any MySQL database on your server
    //DEFINE SQL QUERY:
    //you can use just about ANY kind of select statement you want -
    //edit this to suit your needs!
    $sql = "Select * from $DB_TBLName";
    //Optional: print out title to top of Excel or Word file with Timestamp
    //for when file was generated:
    //set $Use_Titel = 1 to generate title, 0 not to use title
    $Use_Title = 1;
    //define date for title: EDIT this to create the time-format you need
    $now_date = date('m-d-Y H:i');
    //define title for .doc or .xls file: EDIT this if you want
    $title = "Dump For Table $DB_TBLName from Database $DB_DBName on $now_date";
    Leave the connection info below as it is:
    just edit the above.
    (Editing of code past this point recommended only for advanced users.)
    //create MySQL connection
    $Connect = @mysql_connect($DB_Server, $DB_Username, $DB_Password)
    or die("Couldn't connect to MySQL:<br>" . mysql_error() . "<br>" . mysql_errno());
    //select database
    $Db = @mysql_select_db($DB_DBName, $Connect)
    or die("Couldn't select database:<br>" . mysql_error(). "<br>" . mysql_errno());
    //execute query
    $result = @mysql_query($sql,$Connect)
    or die("Couldn't execute query:<br>" . mysql_error(). "<br>" . mysql_errno());
    //if this parameter is included ($w=1), file returned will be in word format ('.doc')
    //if parameter is not included, file returned will be in excel format ('.xls')
    if (isset($w) && ($w==1))
    $file_type = "msword";
    $file_ending = "doc";
    }else {
    $file_type = "vnd.ms-excel";
    $file_ending = "xls";
    //header info for browser: determines file type ('.doc' or '.xls')
    header("Content-Type: application/$file_type");
    header("Content-Disposition: attachment; filename=database_dump.$file_ending");
    header("Pragma: no-cache");
    header("Expires: 0");
    /* Start of Formatting for Word or Excel */
    if (isset($w) && ($w==1)) //check for $w again
    /* FORMATTING FOR WORD DOCUMENTS ('.doc')   */
    //create title with timestamp:
    if ($Use_Title == 1)
      echo("$title\n\n");
    //define separator (defines columns in excel & tabs in word)
    $sep = "\n"; //new line character
    while($row = mysql_fetch_row($result))
      //set_time_limit(60); // HaRa
      $schema_insert = "";
      for($j=0; $j<mysql_num_fields($result);$j++)
      //define field names
      $field_name = mysql_field_name($result,$j);
      //will show name of fields
      $schema_insert .= "$field_name:\t";
       if(!isset($row[$j])) {
        $schema_insert .= "NULL".$sep;
       elseif ($row[$j] != "") {
        $schema_insert .= "$row[$j]".$sep;
       else {
        $schema_insert .= "".$sep;
      $schema_insert = str_replace($sep."$", "", $schema_insert);
      $schema_insert .= "\t";
      print(trim($schema_insert));
      //end of each mysql row
      //creates line to separate data from each MySQL table row
      print "\n----------------------------------------------------\n";
    }else{
    /* FORMATTING FOR EXCEL DOCUMENTS ('.xls')   */
    //create title with timestamp:
    if ($Use_Title == 1)
      echo("$title\n");
    //define separator (defines columns in excel & tabs in word)
    $sep = "\t"; //tabbed character
    //start of printing column names as names of MySQL fields
    for ($i = 0; $i < mysql_num_fields($result); $i++)
      echo mysql_field_name($result,$i) . "\t";
    print("\n");
    //end of printing column names
    //start while loop to get data
    while($row = mysql_fetch_row($result))
      //set_time_limit(60); // HaRa
      $schema_insert = "";
      for($j=0; $j<mysql_num_fields($result);$j++)
       if(!isset($row[$j]))
        $schema_insert .= "NULL".$sep;
       elseif ($row[$j] != "")
        $schema_insert .= "$row[$j]".$sep;
       else
        $schema_insert .= "".$sep;
      $schema_insert = str_replace($sep."$", "", $schema_insert);
      //following fix suggested by Josue (thanks, Josue!)
      //this corrects output in excel when table fields contain \n or \r
      //these two characters are now replaced with a space
      $schema_insert = preg_replace("/\r\n|\n\r|\n|\r/", " ", $schema_insert);
      $schema_insert .= "\t";
      print(trim($schema_insert));
      print "\n";
    ?>
    <?php /*_____________________END___OF___THE___CODE______________________
    get more code from http://www.fundisom.com/phparadise/
    ___________________________________________________________________*/ ?>

    Never mind. The web hosting support people people told me I had my parameters wrong. It works fine now.

  • Fields missing from MYSQL table in Database Expert

    I have just updgraded from Crystal XI to 2011 and I am still having issues with joining a mysql table to any other table.
    Fields show up in field explorer but when I try to uise Database expert the only filed in the MYSQL table is the ID field.
    Am I missing something here. Same problem with both versions. When I runa report using just the mysql table evrything works fine.

    Typically if the field doesn't show up the CR can't figure out what type it is which means when we query the DB for the field type the client/server returns the wrong type or some type that CR doesn't support.
    How is the field defined on the server?
    Thank you
    Don

  • How to insert data into the mysql table by giving as a text file

    Hi,
    Any one know's how to insert data into the mysql table by giving as a text file as the input in JSP.Please respond ASAP.
    Thanks:)

    At least you can try StringTokenizer to parse your text files. Or download a text JDBC driver to parse your files, for instance, HXTT Text(www.hxtt.net) or StelsCSV(www.csv-jdbc.com).

  • How to upload MYSQL tables to Linux server

    I have been testing a PHP/MYSQL site on my own local apache
    server, now am ready to upload to internet. My hosting company is
    Papazilla.com which is an exact clone of GoDaddy.com.
    I used the GoDaddy/Papazilla interface to create 3 tables
    that my site needs.
    Now I need to import records into the tables.
    My tables were created on my computer using PHPmyAdmin. The
    tables appear on my computer at this path:
    C:\xampp\mysql\data\megazilladb
    Each table has 3 files as listed here:
    addurl.frm
    addurl.myd
    addurl.myi
    cats.frm
    cats.myd
    cats.myi
    sites.frm
    sites.myd
    sites.myi
    I think the myd extension has the data, but I'm not sure.
    GoDaddy/Papazilla says I can't just upload my complete
    tables, I first have to create empty tables on their site, then
    upload the data later.
    I went to the GoDaddy/Papazilla interface and created 3 empty
    tables named:
    cats
    sites
    addurl
    Then I went to the database management screen, selected the
    IMPORT tab, and clicked the BROWSE button.
    I browsed for the file "sites.myd"
    Then I clicked GO
    This brought up an error message:
    #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 ||x|||www.classicboat.com|antique Boats For Sale? etc,
    etc.
    The data after the ||x||| above is the info in the first
    field of the first record in the table.
    The error message goes on to list the rest of the fields in
    the record.
    When I called Papazilla to get help, they said I can only use
    the BROWSE button to upload files that end with the .SQL extension.
    Why don't my files have that extension?
    What can I try next to get the records uploaded into my
    tables?
    Thank you for your help

    .oO(lazybones2)
    >I have been testing a PHP/MYSQL site on my own local
    apache server, now am
    >ready to upload to internet. My hosting company is
    Papazilla.com which is an
    >exact clone of GoDaddy.com.
    >
    > I used the GoDaddy/Papazilla interface to create 3
    tables that my site needs.
    >
    > Now I need to import records into the tables.
    >
    > My tables were created on my computer using PHPmyAdmin.
    The tables appear on
    >my computer at this path:
    > C:\xampp\mysql\data\megazilladb
    In addition to David's reply - you should never touch the
    data directory
    of the DB directly. It's completely under the control of the
    server. You
    don't really know which data is stored where and how (it gets
    even more
    complicated with InnoDB tables for example) and actually you
    don't have
    to know that, because these directories are not meant for
    user access.
    So better think of the SQL server as a black box, keep your
    hands off
    its data directories and use SQL commands for all actions.
    Micha

  • Making a jtable auto updates itself from a mysql table

    Pretty much what the title says. How can i auto update the jtable for every time my mysql table is updated in anyway? i am implementing this auto update function in my admin program which displays a list of users who are online etc. from the moment a user is offline/online or changes other details displayed in my jtable, i want it to auto update the jtable as soon as the actual mysql table has been updated with new data...
    I was thinking of re doing the whole jtable i made and create a thread for that table that has a infinite while loop that keeps repainting the jtable with the new updated data from a mysql table query eg select * from table and store the data into a resultset which then gets transferred into a vector. Load the vector into the jtbale and their ya go�.
    what you think of this approach? Is their a better way to do this?
    at the moment, as soon as my application opens, the jtable views all the data from my sql table, however if it doesnt auto updates itself, cheers

    i am implementing this auto update
    function in my admin program which displays a list of
    users who are online etc. from the moment a user is
    offline/online or changes other details displayed in
    my jtable, i want it to auto update the jtable as
    soon as the actual mysql table has been updated with
    new data...Well you can make some changes to make implementation easy
    Ex: Create a table to keep a log of the changes in the system the dmin program read the log and replicate the changes as specified in the log on the table model.
    When reading the log the admin program keep track of the sequence no of the last read log entry and it reads ony the entries which has larger seq numbers than the last read seq no
    I dont think that it is critical to make this to be cloase to real time. An Update once a 1 or 2 secs should be sufficient.

  • CREATE TABLE for another OWNER/SCHEMA and in another TABLESPACE?

    I am logged in a SYSTEM user. Now I want to create a table aaa. The owner of this table should not be SYSTEM but user KARL. and the TABLESPACE should not be SYSTEM but the (existing) TABLESPACE tttt.
    As far as I know I can achieve this by issuing the following command:
    CREATE TABLE KARL.aaa ( a INTEGER, .......) TABLESPACE tttt;
    Regarding the TABLESPACE parameter I am not sure. Is it possible to allocate a TABLE for User Karl in a TABLESPACE which is not assigned to him?
    Furthermore I have an additional problem.
    I have a script with hundreds of CREATE TABLE + ALTER TABLE + CREATE INDEX DDL statements.
    All of them are not prepended with Schema/Owner and an TABLESPACE clause.
    Can I put somehow one single instruction at the top of the script which telles Oracle
    to use
    - OWNER Karl as Schema/Owner for all subsequent DDL stements
    - TABLESPACE tttt as TABLESPACE for all subsequent DDL stements
    In MYsql there is a "use <database>" statement. Is there soemthing similar for Oracle?
    Thank you
    Peter

    Yes... you can do that. Take for example a user A who has a secret password that you don't wish to give out... like an application schema. User B needs to make tables/objects in schema A and you want to track what user B is doing. First setup Oracles Fine Grained Auditing and then grant "connect through" from user A to user B as follows:
    SQL> create user b identified by abc123
      2    quota unlimited on users;
    User created.
    SQL> grant create session to b;
    SQL> create user a identified by abc123
      2    quota unlimited on users;
    User created.
    SQL> grant create table
      2      , create session
      3     to a;
    Grant succeeded.
    SQL> alter user a grant connect through b;
    User altered.
    SQL> connect b[a]/abc123@a486
    Connected.
    SQL> show user
    USER is "A"
    SQL> create table a.my_proxy_table
      2  ( c1 number
      3  , c2 varchar2(50)
      4  , c3 date
      5  );
    Table created.-----
    See that I connected using the "username[proxyuser]" syntax. Also notice that user B is by proxy user A, illustrated by my "show user" command. The connect through can be granted/revoked as needed without divulging A's password to B. In addition, your audit tables or xml logs will track the fact that user B created table a.my_proxy_table.
    Hope this helps,
    John

Maybe you are looking for