1. Crystal Reports Question

    Date: 04/10/08 (SQL Server)    Keywords: database, sql

    Hi,

    I'm new to this community. I joined last week. I hope posting a Crystal Reports question is OK to do here.

    I'm using a SQL server to store a database that contains calibration data. I have been using Crystal Reports to create calibration certificates and so far everything has been working fine. Recently I started working on a way to create calibration labels using Crystal Reports. I have everything laid out fine and all the correct data is being displayed. The problem I am having is trying to make the report start printing from a specific location.

    I'm trying to print to a sheet of labels. There are 30 labels on the sheet. 10 rows and 3 columns. There isn't a problem if I'm trying to print on a brand new sheet of labels. The problem I'm running into is trying to start printing on a specific row/column.

    For example, I had a brand new label sheet and printed 13 calibration labels. So I have used up the first 4 rows and the first column on the fifth row. Now the next time I want to print calibration labels I want to start on the second column of the fifth row. Does anyone know a way to do this?

    I'm currently using Crystal Reports 8.0 but I'm planning on getting the newest version in a few weeks.

    Source: http://community.livejournal.com/sqlserver/66378.html

  2. Selective Replication in mySQL 5.X

    Date: 02/03/09 (MySQL Communtiy)    Keywords: mysql, database, sql

    Folks may remember last week when I was asking questions about mysqldumps. I was doing that in order to get a DB backup for a specific database we wanted to replicate on another server, and I've been working on that.

    After some hit and miss I think I nearly got it working, at least to a point where the replication started between the Master and the slave. It seemed to work for a few seconds, then bombed when the slave tried to execute a statement that was for a DB that it didn't have in it.

    The point is that of all the several databases on the Master machine, at this point we only want to replicate one on the slave machine. I thought I had had that set up in the slave's my.cnf with the line

    replicate-do-db - aid #aid is the database we want to replicate

    however High Performance MySQL says that this is not the way to do this since filtering will be done on the current default database. "This is not usually what you want." :-)

    The book does indicate that "On the slave, the relicate_* options filter events as the slave SQL thread reads them from the relay log." This make sense to me, and at this point it also makes sense that the log coming from the master has every statement coming into the DB. It goes on to say that "You can replicate or ignore one or more databases (emphasis mine)...based on LIKE pattern matching syntax." There is where I lose it. I understand how to use the LIKE syntax in mySQL statements, but not in this environment.

    Is it possible to set up a small battery of statements in the slave my.cnf along the lines of:

    replicate_ignore_table = .%

    Would that do it?

    Is anyone basically doing replication in a simple Master-Slave relationship where you are only replicating one DB? If so, how are you doing it?

    THANKS, folks!

    Source: http://community.livejournal.com/mysql/133717.html

  3. Restoring from a mySQLDump...

    Date: 01/28/09 (MySQL Communtiy)    Keywords: mysql, database, sql

    Folks, I'm having what I think is a weird problem restoring a DB from a mysqldump. What I'm trying to do is basically copy a DB from one mysql database server to another.

    The mysqldump command I used originally was:

    mysqldump --quick --add-locks --extended-insert -u root -p dbname > dbname.sql

    When this didn't work upon restoration I also tried:

    mysqldump --opt -u root -p dbname > dbname.sql

    Both these commands created the dbname.sql file with no problems or complaints.

    I copied the SQL file over to the target computer. I went into mySQL as root and did:

    create database dbname;
    use dbname;
    source dbname.sql;

    The import would start, but it wouldn't get very far. In the end, after not many seconds it would just...stop. Here is an example:


    Query OK, 8708 rows affected (0.11 sec)
    Records: 8708 Duplicates: 0 Warnings: 0

    Query OK, 8750 rows affected (0.12 sec)
    Records: 8750 Duplicates: 0 Warnings: 0

    Query OK, 8740 rows affected (0.11 sec)
    Records: 8740 Duplicates: 0 Warnings: 0

    Query OK, 8758 rows affected (0.11 sec)
    Records: 8758 Duplicates: 0 Warnings: 0

    Query OK, 8745 rows affected (0.12 sec)
    Records: 8745 Duplicates: 0 Warnings: 0


    And it would just stop here. I waited several minutes, and the load average of the machine went down to normal levels. The mySQLd stopped showing up on top.

    I'd then CNTRL-C the process and get:


    ^CQuery aborted by Ctrl+C
    ^CAborted
    mysql: 0 files and 1 streams is left open

    $


    I've done this a few times and the results have been consistent(ly bad). As I mentioned I also did two separate mysqldumps and both files failed to import the same way.

    While the import was happening I watched "top." There didn't seem to be a memory issue since the mysqld never used more than 0.3% of the memory, although it did use 96% of the CPU (which was fine).

    The mysqlds are running on the same operating system - Fedora 10 x_64. The only difference between them is the dump was done on mysql 5.0.27, and I am trying to source to a mysqld v5.0.67.

    Any thoughts?

    Source: http://community.livejournal.com/mysql/133572.html

  4. calling remote stored procedure

    Date: 12/17/08 (MySQL Communtiy)    Keywords: mysql, database, sql

    I need to "synchronize" the output of a stored procedure in one database (I don't have access to any tables there, just stored procedures) and a table in another database. So I need to call a remote stored procedure once in a while and populate a local table with its output. For the remote database, I know hostname, port, username, password and db name.

    Is this possible in mysql? Any help would be appreciated

    Source: http://community.livejournal.com/mysql/133145.html

  5. MySQL IDE options

    Date: 12/11/08 (MySQL Communtiy)    Keywords: mysql, database, sql

    I'm starting a new consulting gig that requires me to work on a MySQL database. Typically, I use Rapid SQL as my IDE, but I have been informed that it doesn't support 5.x. What IDEs out there support MySQL 5?

    Source: http://community.livejournal.com/mysql/132964.html

  6. i used to think i understood SQL

    Date: 07/24/08 (MySQL Communtiy)    Keywords: database, sql

    I used to use MS Access a lot and I know a little about SQL. My company wants me to change job roles and part of my new role will be writing queries for our company database. All I've ever had to do with SQL was write simple queries, and I usually just built the query in Access and modified as needed. As a test for this position, which I don't really want, they had me write some test queries. This is the first one I came up with and it's so convoluted I ended up needing Access to do it anyway.


    SELECT
    tblCust.FName, tblCust.LName, tblAdvCust.CardID, tblContacts.Phone, tblAddresses.FirstLine, tblAddresses.SecondLine, tblAddresses.ThirdLine, tblAddresses.City, tblAddresses.State, tblAddresses.Zip, tblCountry.Description

    FROM
    tblCountry INNER JOIN (tblAddresses INNER JOIN (tblContactTypes INNER JOIN ((((tblCust INNER JOIN tblAdvCust ON tblCust.CustomerID = tblAdvCust.CustomerID) INNER JOIN tblCustomerMembers ON (tblCust.CustomerID = tblCustomerMembers.CustomerID) AND (tblCust.CustomerID = tblCustomerMembers.MemberID)) INNER JOIN tblDealer ON tblAdvCust.DealerID = tblDealer.DealerId) INNER JOIN tblContacts ON tblCust.OwnerID = tblContacts.ReferTo) ON (tblContactTypes.ContactTypeId = tblContacts.ContactTypeId) AND (tblContactTypes.ContactTypeId = tblContacts.ContactTypeId) AND (tblContactTypes.ContactTypeId = tblContacts.ContactTypeId) AND (tblContactTypes.ContactTypeId = tblContacts.ContactTypeId))ON tblAddresses.OwnerID = tblCust.OwnerID) ON tblCountry.CountryID = tblAddresses.CountryID

    WHERE
    tblDealer.DealerId="109" AND tblContactTypes.ContactTypeId=1;

    Now, maybe they haven't explained it to me well enough, maybe they think I have more experience with SQL than I do and just assume there are things I know that I don't. I don't know. But am I expected to be able to write this sort of thing by hand? If I won't have some tools at my disposal to write this up, how am I expected to do this? I can't even wrap my head around this and for the life of me, because of the way the relationships in the database are set up, I couldn't think of a simpler way to do it.

    I'm probably going to turn this job down but it seems like they really want me to do it. So if there's a simpler way to go about this, I want to be able to do it. But this is bollocks.

    Source: http://community.livejournal.com/mysql/130809.html

  7. Weird problem with WHERE DATE(datetimefield)=something

    Date: 06/26/08 (MySQL Communtiy)    Keywords: mysql, database, sql

    I have two RHEL5 machines, both built & configured at the same time. Both have MySQL 5.0.45 installed and share an identical database.

    So - this query returns 334 on one machine, and 0 on the other:

    • SELECT COUNT(*) FROM mytable WHERE DATE(datetimefield) = '2008-05-05';

    I put that in red, since it seems to be where the problem is. The strange thing is that both machines returned 334 yesterday.

    If I change the query (on the supposed broken box) to this:

    • SELECT COUNT(*) FROM mytable WHERE datetimefield LIKE '2008-05-05%';

    I get 334.

    I realize there several ways of doing this, but I'm more interested in why, out of nowhere, MySQL decides not to allow WHERE DATE(datetimefield)=blah anymore.

    Ideas?

    Source: http://community.livejournal.com/mysql/130037.html

  8. ERROR 1201 (HY000): Could not initialize master info structure ...

    Date: 06/17/08 (MySQL Communtiy)    Keywords: mysql, database, sql, linux

    Hello all. I'm so bored to kill this error ... can anybody help me?

    I have one master and about 10 slave servers. Time to time one (absolutely random) slave server lost replication connection. When i type slave stop; slave start; i see "ERROR 1201 (HY000): Could not initialize master info structure; more error messages can be found in the MySQL error log"

    When i look at /var/log/mysql.log, i see

    [ERROR] Failed to open the relay log '/var/run/mysqld/mysqld-relay-bin.000759' (relay_log_pos 235)
    080617 12:25:45 [ERROR] Could not find target log during relay log initialization

    OK, "slave reset", drop databases , set MASTER etc, slave start - and replication does just fine. without any errors. Until the next time.

    I add to my.cnf next lines:

    max-relay-log-size=1M
    max-binlog-size=2M
    relay-log=/var/run/mysqld/mysqld-relay-bin

    But without any effect: replication may work fine long time or break at next hour.

    Question: how can set replication, that always work ? :)

    Platform: Linux Fedora 6 & 7, mysql 5.0.45, no any errors about disk or memory. Size of replication tables - about 1-2Mb

    Source: http://community.livejournal.com/mysql/129177.html

  9. Restrict mysql user to certain IP

    Date: 06/04/08 (MySQL Communtiy)    Keywords: mysql, database, sql

    Is there a way to bind mysql users to a specific server IP?

    I have two databases running from the same server. I need to ensure that database ABC only allows activity from server IP 123.000.000.111. A second database (XYZ) should only allow activity from server IP 123.000.000.222. Both IPs and databases are on the same box (multiple nics).


    If I've explained this poorly please let me know so I can clarify.

    Source: http://community.livejournal.com/mysql/128663.html

  10. Database sync

    Date: 04/28/08 (MySQL Communtiy)    Keywords: mysql, database, sql, web

    I'm working on setting a mirror copy of some websites. The part I'm not sure about the best way to handle things is the MySQL database (I have rsync for the files)

    Currently, a script would run from the mirror to collect the MySQL data from the site with the live data (using SSH to run a mysqldump command, then SCP the dump file to itself) and overwrite the data on it's local copy.

    I'm just wondering if there is something better (and no, I don't have root access at all. I only have access to some databases VIA the MySQL client)

    Source: http://community.livejournal.com/mysql/128050.html

  11. MySQL, DRDB and large databases

    Date: 04/28/08 (MySQL Communtiy)    Keywords: mysql, database, sql

    Greetings,

    We will be upgrading to MySQL 5.0 (either 5.0.58 or 5.0.60 when it becomes available) 4.1 this summer and we are considering using DRDB. My concerns, as the dba are:

    1. Failover time. We are currently running a single, monolithic InnoDB database that has grown to 342G. When I shutdown the server it has taken as long as 40 minutes for InnoDB to flush all data to disk. My concern is that with DRDB, if we have a hardware failure on the DRDB master, with DRDB block-level replication, the DRDB slave's datadir and logdir files will be in the same state as the master when it failed and startup of MySQL could take a long time. Currently we are handling failover with replication and scripts to redirect who the master is.

    2. Table Maintenance. Some of our tables are quite large. One is at 90GB. To rebuild indexes and defrag tables, I would run ALTER TABLE blah ENGINE=InnoDB on the slave and then failover to it. With DRDB, if I understand it correctly, this would not be possible.

    My concerns are that due to the size of our database DRDB may not be the optimal choice. I would appreciate anybody's comments on this.

    Source: http://community.livejournal.com/mysql/127896.html

  12. php driven image gallery - help needed

    Date: 03/10/09 (PHP Community)    Keywords: php, mysql, database, sql, web

    (x-posted to '[info]'php_dev)

    Hey guys,

    I'm coding an image gallery to use on my PHP site and need a bit of help with a couple of features I want to code into it. I was hoping someone here could either give me some pointers or send me to a website that will help with either explainations or code snippets :)

    1. Firstly, thumbnails. I have created an admin panel where I upload the images and can set various things like the category, title etc, and all that is stored in a MySql database, and the file uploaded to a general directory. But i'd also like to create a thumbnail of the image as it uploads. I've found several scripts that make thumbnails from images already in a directory, but i'd like it to happen as I upload the image. Is that possible? Without having to use some all-in-one image gallery script heh. I'd also need it to resize the image proportionally so that images aren't just squashed into a 100x100 square shape.

    2. Secondly, I'd like to "tag" images like with LJ entries, so that on the front end when a picture is being viewed, the list of tags is shown and can be clicked on to show other image thumbnails with the same tag. But i'm not really sure how to go about this... I was just going to have a table field called img_tags and store them all in that per image, but then is that efficient? searching for matches within a db field? any tips or suggestions?

    3. oh and as an extra thought, how can i then take those tags and make a tag cloud maybe?

    All and any help would be most appreciated! :)

    paul
    x

    Source: http://community.livejournal.com/php/659077.html

  13. Juli's dumb question of the day

    Date: 01/12/09 (PHP Community)    Keywords: mysql, database, sql

    Hi everyone! Time for another one of my dumb questions!

    The short version: Why do my try/catch blocks not seem to catch properly?



    I'm using MySQL to update a recipe database I'm creating (and have been creating for just about forever. It's one of those projects that you can only pick up in your very limited spare time) and just for grins, I wanted to test and see if the try/catch blocks I set up to catch MySQL errors in host connection, database connection, and query running worked.

    So I changed the password to see if they would work. Let me tell you, it was a big pile of fail and MySQL errors.

    In theory, if the connection to the host is unsuccessful, it should say "Problem connecting to the host" and give the info stored in mysql_error(). But it doesn't. It just plugs along and fails like the try/catch blocks weren't even there. And I'm not quite sure why.

    So, what have I done to Eff up my Try/catch blocks?

    Example code...

    public function create_recipe()
    {
      try
      {
        $create_connect = $this->_db_connect();
        try
        {
          $this->recipe_id = $this->_set_id($create_connect, "recipes");
    
          //Selects the database from the server.
          $db_select = mysql_select_db("recipes", $create_connect);
          try
          {
            //Query to create the recipe in the database.
            $query = "INSERT INTO recipes ";
            $query .= "VALUES(" . $this->recipe_id . ", '" . 
                      $this->recipe_info["recipeName"] . "', ";
            $query .= "'" . $this->recipe_info["numServings"] . "', '" . 
                      $this->recipe_info["prepTime"] . "', ";
            $query .= "'" . $this->recipe_info["cookTime"] . "', NULL, '" . 
                      $this->recipe_info["origAuthor"] . "', ";
            $query .= "'" . $this->recipe_info["origLocation"] . "', '" . 
                      $this->recipe_info["notes"] . "', NULL);";
            //Timestamp is automatically created in the database upon insert.
            
            //Runs $query on the database.  Stops the script if there is an error.
            $result = mysql_query($query, $create_connect);
            mysql_close($create_connect);
          } //end try $eee
          catch (Exception $eee)
          {
            echo "Problem running the query. " . mysql_error($create_connect);
            echo "

    "; mysql_close($create_connect); } //end catch $eee } //end try $ee catch (Exception $ee) { //Verifies that the database/table connection was successful. If not, it kills the //application. echo "Problem selecting the table. " . mysql_error($create_connect); echo "

    "; mysql_close($create_connect); } //end catch $ee } //end try $e catch (Exception $e) { //Verifies that the connection to the host was successful. If not, it kills the //application. echo "Problem connecting to the host. " . mysql_error(); echo "

    "; } //end catch $e } //end create_recipe() private function _db_connect() { $hostname = "********"; $username = "********"; $password = "********"; return mysql_connect($hostname, $username, $password); } //end db_connect()

    Source: http://community.livejournal.com/php/652844.html

  14. Drag and Drop Listbox

    Date: 02/17/09 (Asp Dot Net)    Keywords: database, asp, sql, web

    Hi,
    What I am trying to do this time is create an asp.net listbox from
    an SQL Server 2005 result set (done) which then users can sort the
    records to form the running order within the same Listbox and then
    submit all the records including the new running order back into
    the database. Each record has already been automatically assigned
    a running order number based on their position in the old website.

    I am looking for suggestions on the quickest and *easist* way to do
    this, examples would be much appreciated. My web application is asp.net
    written in C#.

    Any help is appreciated.

    Source: http://community.livejournal.com/aspdotnet/103147.html

  15. Saving Files from a Website using VB.Net

    Date: 01/28/09 (Asp Dot Net)    Keywords: html, database, web

    I have a site that we are moving from Flat HTML into a Database using in house
    written VB.Net applications. The website is roughly 10,000 pages. The volume of
    pages however is not the problem. The Page HTML content is all now held in a
    database, Now I am looping through the pages and checking each page using regular
    expressions for either a href or img src tag so I can collect the URL for all
    images and attachments. Once I have these, i pass the URL (currently) to the
    HttpWebRequest.DownloadData which makes a request to the website for the url
    provided and then the attachment is downloaded and eventually written out using
    the WriteAllBytes() function. This works for one iterration and then times out.
    What i need to know is why does it time out and is there a better method of doing
    this? the files can be rather large that are getting moved the site is about 5.7gb
    and most of this will be down to diffrent file formats.

    Source: http://community.livejournal.com/aspdotnet/102801.html

  16. update form

    Date: 11/28/08 (Asp Dot Net)    Keywords: database

    I'm trying to create an item update page for a product database, and was wondering if there's something similar to

    ConnectionString="server=...;database=...;uid=...;pwd=..."
    SelectCommand="SELECT * FROM database WHERE (ID = @ID)" >

    DefaultValue="%" />


    for updating and inserting? I use code like that for search queries, and tried changing "select" to "update" in the code to see if that might work, but no luck. I want there to be a 1st page where you select the product to be updated, then that brings you to a form that has all the product info inserted into the form (with the ID disabled), then you can edit and after submitting, it goes to the 3rd page that gives the success message and updates the table. I have the fist two pages working fine, the form populated with the right data, but after hitting submit, I don't get an error regarding the coding, but no data is updated. I tried using the datagrid method on the MSDN site, because it has worked for inserting new data, but, besides also being kinda bulky to use, it didn't work either. Any suggestions?

    Source: http://community.livejournal.com/aspdotnet/102205.html

  17. Access the XSD file, Computer says no!

    Date: 11/28/08 (Asp Dot Net)    Keywords: database, sql

    I keep getting an error the error 1) in my code, I am using a xsd file to call stored procedure and
    access the database. This worked fine under Windows 2000 using visual basic express 2005. I am now
    on a XP Machine using VS 2005 and i can get it to work. The error occurs at this point 2) and the
    code that defines that dataaccess is listed as 3). So what am i doing wrong then all suggestion
    accepted.

    1) Request for the permission of type 'System.Data.SqlClient.SqlClientPermission, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.

    2) content_page = dataaccess.GetContentPages()

    3)

    Dim content_page As Object
    Dim page As Object
    Dim page_number As Integer
    Dim page_content As String

    ' call out the pages from the database
    Dim dataaccess As DataSet1TableAdapters.pagesTableAdapter = New DataSet1TableAdapters.pagesTableAdapter
    content_page = dataaccess.GetContentPages()

    ' Loop through the record set
    For Each page In content_page
    ' assigned the page and content values to variables
    page_number = page
    page_content = page

    Source: http://community.livejournal.com/aspdotnet/101914.html

  18. uuugh.... database issues

    Date: 07/13/08 (Asp Dot Net)    Keywords: database, asp

    I'm trying to set up a database connection with ASP.NET in Dreamweaver MX 2004 (yeah, a little older...), and everything in the site has a check mark that needs to before you add a connection, and I add the database file, and even hit test and it registers fine. Then when I go to add a new record set, I select the database, but it says "***No table found". So apparently it's ok with the file path, it just can't read the database tables.

    I've made sure the .net framework was all good to go, and I downloaded the MDAC 2.7 files and got those all set. Is there something I'm missing? I'm trying to work with Access and asp.net because that's what a position I'm trying to move into uses, so, I don't really have other options.

    Also, I'm thinking maybe there's an issue with drivers because even when I try to hand code it with examples from http://www.w3schools.com/ASPNET/aspnet_repeater.asp, when I call it up in either IE or Firefox, it just displays the code....
    any ideas?

    Source: http://community.livejournal.com/aspdotnet/99757.html

  19. php driven image gallery - help needed

    Date: 03/10/09 (PHP Development)    Keywords: php, mysql, database, sql, web

    (x-posted to '[info]'php)

    Hey guys,

    I'm coding an image gallery to use on my PHP site and need a bit of help with a couple of features I want to code into it. I was hoping someone here could either give me some pointers or send me to a website that will help with either explainations or code snippets :)

    1. Firstly, thumbnails. I have created an admin panel where I upload the images and can set various things like the category, title etc, and all that is stored in a MySql database, and the file uploaded to a general directory. But i'd also like to create a thumbnail of the image as it uploads. I've found several scripts that make thumbnails from images already in a directory, but i'd like it to happen as I upload the image. Is that possible? Without having to use some all-in-one image gallery script heh. I'd also need it to resize the image proportionally so that images aren't just squashed into a 100x100 square shape.

    2. Secondly, I'd like to "tag" images like with LJ entries, so that on the front end when a picture is being viewed, the list of tags is shown and can be clicked on to show other image thumbnails with the same tag. But i'm not really sure how to go about this... I was just going to have a table field called img_tags and store them all in that per image, but then is that efficient? searching for matches within a db field? any tips or suggestions?

    3. oh and as an extra thought, how can i then take those tags and make a tag cloud maybe?

    All and any help would be most appreciated! :)

    paul
    x

    Source: http://community.livejournal.com/php_dev/81475.html

  20. Event Calendar.

    Date: 12/25/08 (PHP Development)    Keywords: html, database, google

    I am trying to write an event calendar application. For no other reason than the learning experience, so please don't answer by "go use google calendars". You don't learn anything that way.

    I have written the part that builds the display of the calendar. I found a class that built a display, but it had all the HTML in the class so I rewrote it to be more of what I wanted.

    Now I want to create the database to store the events. I want to enter an event by date. I want to be able to add an event every 2 weeks on thursday, every 3 months on wednesday, but I am not sure how to approach putting that in the database. Looking for some database structure suggestions.

    Source: http://community.livejournal.com/php_dev/80976.html

Previous page  ||  Next page


antivirus | apache | asp | blogging | browser | bugtracking | cms | crm | css | database | ebay | ecommerce | google | hosting | html | java | jsp | linux | microsoft | mysql | offshore | offshoring | oscommerce | php | postgresql | programming | rss | security | seo | shopping | software | spam | spyware | sql | technology | templates | tracker | virus | web | xml | yahoo | home