Search Results

Search found 18661 results on 747 pages for 'linq to mysql'.

Page 70/747 | < Previous Page | 66 67 68 69 70 71 72 73 74 75 76 77  | Next Page >

  • why installing mysql-server wants to remove sysvinit

    - by E-rich
    I want to install mysql-server-5.5 in a new Debian Squeeze installation, but when I start to install it I get a warning that I don't see as being a requirement: WARNING: The following essential packages will be removed. This should NOT be done unless you know exactly what you are doing! sysvinit It looks like the upstart package will be installed to replace sysvinit. Will proceeding with the install cause damage? Can you help me understand why sysvinit needs to be removed for mysql-server to be installed? Is there a way to install mysql-server without removing sysvinit?

    Read the article

  • MySQL keeps crashing due to bug

    - by mike
    So about a week ago, I finally figured out what was causing my server to continually crash. After reviewing my mysqld.log I keep seeing this same error, 101210 5:04:32 [Warning] option 'max_join_size': unsigned value 18446744073709551615 adjusted to 4294967295 Here is a link to the bug report, http://bugs.mysql.com/bug.php?id=35346 someone recommend that you set the max_join_size vaule in my.cnf to 4M, and I did. I assumed this fixed the issue, and it was working for about a week with no issues until today... I checked MySQL and the same error is now back, 101216 06:35:25 mysqld restarted 101216 6:38:15 [Warning] option 'max_join_size': unsigned value 18446744073709551615 adjusted to 4294967295 101216 6:38:15 [Warning] option 'max_join_size': unsigned value 18446744073709551615 adjusted to 4294967295 101216 06:40:42 mysqld ended Anyone know how I can really fix this issue? I can't keep having mysql crash like this. EDIT: I forgot to mention every time this happens I get an email from linode staying I have a high disk io rate Your Linode, has exceeded the notification threshold (1000) for disk io rate by averaging 2483.68 for the last 2 hours.

    Read the article

  • [SOLVED]Can't enable mysql and mysqli extension in PHP [closed]

    - by Sydcul
    I used to had my website hosted at a hosting company. But i decided to start my own webserver and in order to get phpBB, MediaWiki, etc. working i need PHP and MySQL. So after a bit of screwing around i could get those working but the MySQL and MySQLi extensions do not seem to work. When i use phpMyAdmin, phpBB, whatever it would say it is not installed correctly. I uncommented it in php.ini, i put my PHP folder in path, still not working. Please note i am not a PHP developer at all. Using: Windows Server 2003 Small Buisiness (too lazy to install Linux) Apache2 (not sure what version) PHP 5.2 (threaded, manually installed) MySQL 5.5.28 Thanks in advance, -Sydcul EDIT: Solved. Don't know how, just used the installer and it worked.

    Read the article

  • Spring security and MySQL under CentOS

    - by user223268
    i'm trying to connect to MySQL using spring security, spring should access the database and check the user and pass using direct sql. the problem is when i use localhost to access my local database nothing happen no exceptions no any thing but login fails. if i changed the host of the server to one of my team machine IP address the program login successfully. the only deference is that i'm using CentOS 6.5 and my team is using Windows. how can i make sure i'm configuring MySQL correctly and what privileges should i grand to my users to be able to finish this. note: i'm a newcomer to linux and MySQL server administration.

    Read the article

  • Upgrading Apache, PHP and MySQL

    - by Javacadabra
    I'm looking to upgrade my current version of Apache, PHP and mySQL. I remember when I installed them it was a very intricate and somewhat delicate process and I am sort of afraid to upgrade in case everything just stops working! Currently I am running Apache 2.2.21 and PHP 5.3.5. MySQL is 5.6.4 Does anyone have any ideas how you upgrade these things? I think the current versions are Apache 2.4.3, PHP 5.4.7 and MySQL 5.6. Thanks in advance!

    Read the article

  • LinqToSQL _conn ? LinqToSQLConnection ?

    - by nCdy
    here is a code : using System; using Nemerle.Collections; using Nemerle.Text; //using Nemerle.Utility; using System.Linq; using Nemerle.Data.Linq; using NUnit.Framework; using System.Data.Linq; namespace LinqTestes { [TestFixture] public class Linq2SqlTests { static ReadConnectionString() : string { def currAssm = Uri(typeof(Linq2SqlTests).Assembly.CodeBase).LocalPath; def path = IO.Path.GetDirectoryName(currAssm); def connStrPath = IO.Path.Combine(path, "connectionString.txt"); def connStr = try { IO.File.ReadAllText(connStrPath, Text.Encoding.UTF8) } catch { | e is IO.FileNotFoundException => throw IO.FileNotFoundException( $"You should define connection string to NorthWind DB in: '$connStrPath'", e.FileName, e) }; connStr } _conn : LinqDataConnection = LinqDataConnection(ReadConnectionString()); and I'm making the same but what is LinqDataConnection type ? and where does it comes from ?

    Read the article

  • C# Dynamic Query Without A Database Model

    - by hitopp
    I have been searching the web for a solution to dynamic queries. I have found many different solutions (e.g. Linq to Sql, Dynamic Linq Expressions, Dynamic Query), but all of these solutions involve some sort of previous knowledge of the database (like a model in code). Maybe what I am asking is way off the deep end, but is there any possible way to dynamically query a database without a model? For example, a database has a Customers table with the following columns: CustomerID Name FavoriteColor I want to create a query as SELECT Name FROM Customers WHERE @0 = @1, where the two placeholders are populated dynamically. The resulting data does not tie to a model class and I would prefer to use some sort of framework to build the queries, not simple string concatenation. The System.Linq.Dynamic namespace came really close to fulfilling this request, but it uses a database model. I realize this is crazy, but I was just curious.

    Read the article

  • Considering Embedding a Database? Choose MySQL!

    - by Bertrand Matthelié
    The M of the LAMP stack and the #1 database for Web-based applications, MySQL is also an extremely popular choice as embedded database. Normal 0 false false false EN-US X-NONE X-NONE /* Style Definitions */ table.MsoNormalTable {mso-style-name:"Table Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-priority:99; mso-style-qformat:yes; mso-style-parent:""; mso-padding-alt:0cm 5.4pt 0cm 5.4pt; mso-para-margin:0cm; mso-para-margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:11.0pt; font-family:"Calibri","sans-serif"; mso-ascii-font-family:Calibri; mso-ascii-theme-font:minor-latin; mso-fareast-font-family:"Times New Roman"; mso-fareast-theme-font:minor-fareast; mso-hansi-font-family:Calibri; mso-hansi-theme-font:minor-latin; mso-bidi-font-family:"Times New Roman"; mso-bidi-theme-font:minor-bidi;} Access our Resource Kit to discover the top reasons why:   3,000 ISVs and OEMs rely on MySQL as their embedded database 8 of the top 10 software vendors and hundreds of startups selected MySQL to power their cloud, on-premise and appliance-based offerings Leading mobile and SaaS providers ensure continuous service availability and scalability with lower cost and risk using MySQL Cluster. Learn how you can reduce costs and accelerate time to market while increasing performance and reliability. Access white papers, webinars, case studies and other resources in our Resource Kit.  

    Read the article

  • How to Link VS2010 Database Project and LINQ to SQL

    - by Jason
    As I am working with the new database projects in VS2010, and as I am learning LINQ to SQL, I am curious as to the best way to link the two groups of information so that when I update one, the other updates along with it. From my research here at SO, as well as in Google, it appears the general rule of thumb is: "Build the database, and then create your LINQ to SQL classes." Of course, if I make a change in my database, the LINQ to SQL doesn't update automatically and I have to do it by hand. This is fairly simple right now as my database is small, but I am curious if there is an easier way for this to happen. In addition, the LINQ to SQL tool is pretty nice. The ability to create tables, add associations, and even create inheritance is very simple. As my second question, I am curious as to whether or not VS2010 can work the other way - I design the database in the DBLM file and then link it back to my database project. I appreciate any help with either of these two questions. I'm really interested in making this as easy as possible to reduce errors during development and improve the speed at which changes can be made.

    Read the article

  • Selecting a multi-dimensional array in LINQ

    - by mckhendry
    I have a task where I need to translate a DataTable to a two-dimensional array. That's easy enough to do by just looping over the rows and columns (see example below). private static string[,] ToArray(DataTable table) { var array = new string[table.Rows.Count,table.Columns.Count]; for (int i = 0; i < table.Rows.Count; ++i) for (int j = 0; j < table.Columns.Count; ++j) array[i, j] = table.Rows[i][j].ToString(); return array; } What I'd really like to do is use a select statement in LINQ to generate that 2D array. Unfortunately it looks like there is no way in LINQ to select a multidimensional array. Yes, I'm aware that I can use LINQ to select a jagged array, but that's not what I want. Is my assumption correct, or is there a way to use LINQ to select a multi-dimensional array?

    Read the article

  • Merging sequences by type With LINQ

    - by jankor
    I want to use LINQ to convert this IEnumerable<int>[] value1ByType = new IEnumerable<int>[3]; value1ByType[0]= new [] { 0}; value1ByType[1]= new [] {10,11}; value1ByType[2]= new [] {20}; var value2ToType = new Dictionary<int,int> { {100,0}, {101,1}, {102,2}, {103,1}}; to this var value2ToValue1 = new Dictionary<int,int> { {100, 0}, {101,10}, {102,20}, {103,11}}; Is there a way to do this with LINQ? Without LINQ I would use multiple IEnumerators, one for each IEnumerable of value1ByType. like this: // create enumerators var value1TypeEnumerators = new List<IEnumerator<int>>(); for (int i = 0; i < value1ByType.Length; i++) { value1TypeEnumerators.Add(value1ByType[i].GetEnumerator()); value1TypeEnumerators[i].MoveNext(); } // create wanted dictionary var value2ToValue1 = new Dictionary<int, int>(); foreach (var item in Value2ToType) { int value1=value1TypeEnumerators[item.Value].Current; value2ToValue1.Add(item.Key, value1); value1TypeEnumerators[item.Value].MoveNext(); } Any Idea how to do this in LINQ?

    Read the article

  • LINQ Query please help C#.Net.

    - by Paul Matthews
    I'm very new to LINQ and struggling to find the answers. I have a simple SQL query. Select ID, COUNT(ID) as Selections, OptionName, SUM(Units) as Units FROM tbl_Results GROUP BY ID, OptionName. The results I got were: '1' '4' 'Approved' '40' '2' '1' 'Rejected' '19' '3' '2' 'Not Decided' '12' Due to having to encrypt all my data in the database I'm unable to do sums. Therefore I have now brought back the data and decrypt it in the application layer. Results would be: '1' 'Approved' '10' '3' 'Not Deceided' '6' '2' 'Rejected' '19' '1' 'Approved' '15' '1' 'Approved' '5' '3' 'Not Deceided' '6' '1' 'Approved' '10' using a simple class I have called back the above results, and put them in a list class. public class results { public int ID {get;set;} public string OptionName {get;set;} public int Unit {get;set;} } I almost have the LINQ query to bring back the results like the SQL query at the top var q = from r in Results group p.Unit by p.ID int g select new {ID = g.Key, Selections = g.Count(), Units = g.Sum()}; How do I ensure my LINQ query also give me the Option Name? Also if I created a class called Statistics to hold my results how would I modify the LINQ query to give me list result set? public class results { public int ID {get;set;} public int NumberOfSelections { get; set; } public string OptionName {get;set;} public int UnitTotal {get;set;} }

    Read the article

  • Show me your Linq to SQL architectures!

    - by Brad Heller
    I've been using Linq to SQL for a new implementation that I've been working on. I have about 5000 lines of code and am a little ways from a solid demo. I've been pretty satisfied with Linq to SQL so far -- the tools are excellent and pretty painless and it allows you to get a DAL up and running quickly. That said, there are some major draw backs that I just keep hitting over and over again. Namely how to handle separation of concerns between my DAL and my business layer and juggling that with different data contexts. Here is the architecture I've been using: My repositories do all my data access and they return Linq to SQL objects. Each of my Linq to SQL objects implements an IDetachable interface. A typical implementation looks like this: partial class PaymentDetail : IDetachable { #region IDetachable Members public bool IsAttached { get { return PropertyChanging != null; } } public void Detach() { if (IsAttached) { PropertyChanged = null; PropertyChanging = null; Transaction.Detach(); } } #endregion } Every time I do a DAL operation in my repository I "detach" when I'm done with the object (and it should theoretically detach from any child objects) to remove the DataContext's context. Like I said, this works pretty well, but there are some edge cases that seem to be a big pain in the ass. For instance, my Transaction object has many PaymentDetails. Even when there are no PaymentDetails in that collection it's still attached to the DataContext's context! Thus, if I try to update (I update by Attach()ing to the object and then SubmitChanges()) I get that dreaded "An attempt has been made to Attach or Add an entity that is not new, perhaps having been loaded from another DataContext. This is not supported." message. Anyway, I'm starting to doubt that this technology was a good gamble. Has anyone got a decent architecture that they're willing to share? I'd really love to use this technology but I feel like I spend 1/3 of my time just debugging is retarded quirks!

    Read the article

  • VB.NET switching from ADO.NET to LINQ

    - by Cj Anderson
    I'm VERY new to Linq. I have an application I wrote that is in VB.NET 2.0. Works great, but I'd like to switch this application to Linq. I use ADO.NET to load XML into a datatable. The XML file has about 90,000 records in it. I then use the Datatable.Select to perform searches against that Datatable. The search control is a free form textbox. So if the user types in terms it searches instantly. Any further terms that are typed in continue to restrict the results. So you can type in Bob, or type in Bob Barker. Or type in Bob Barker Price is Right. The more criteria typed in the more narrowed your result. I bind the results to a gridview. Moving forward what all do I need to do? From a high level, I assume I need to: 1) Go to Project Properties -- Advanced Compiler Settings and change the Target framework to 3.5 from 2.0. 2) Add the reference to System.XML.Linq, Add the Imports statement to the classes. So I'm not sure what the best approach is going forward after that. I assume I use XDocument.Load, then my search subroutine runs against the XDocument. Do I just do the standard Linq query for this sort of repeated search? Like so: var people = from phonebook in doc.Root.Elements("phonebook") where phonebook.Element("userid") = "whatever" select phonebook; Any tips on how to best implement?

    Read the article

  • Alternatives to LINQ To SQL on high loaded pages

    - by Alex
    To begin with, I LOVE LINQ TO SQL. It's so much easier to use than direct querying. But, there's one great problem: it doesn't work well on high loaded requests. I have some actions in my ASP.NET MVC project, that are called hundreds times every minute. I used to have LINQ to SQL there, but since the amount of requests is gigantic, LINQ TO SQL almost always returned "Row not found or changed" or "X of X updates failed". And it's understandable. For instance, I have to increase some value by one with every request. var stat = DB.Stats.First(); stat.Visits++; // .... DB.SubmitChanges(); But while ASP.NET was working on those //... instructions, the stats.Visits value stored in the table got changed. I found a solution, I created a stored procedure UPDATE Stats SET Visits=Visits+1 It works well. Unfortunately now I'm getting more and more moments like that. And it sucks to create stored procedures for all cases. So my question is, how to solve this problem? Are there any alternatives that can work here? I hear that Stackoverflow works with LINQ to SQL. And it's more loaded than my site.

    Read the article

  • LINQ Joins - Performance

    - by Meiscooldude
    I am curious on how exactly LINQ (not LINQ to SQL) is performing is joins behind the scenes in relation to how Sql Server performs joins. Sql Server before executing a query, generates an Execution Plan. The Execution Plan is basically an Expression Tree on what it believes is the best way to execute the query. Each node provides information on whether to do a Sort, Scan, Select, Join, ect. On a 'Join' node in our execution plan, we can see three possible algorithms; Hash Join, Merge Join, and Nested Loops Join. Sql Server will choose which algorithm to for each Join operation based on expected number of rows in Inner and Outer tables, what type of join we are doing (some algorithms don't support all types of joins), whether we need data ordered, and probably many other factors. Join Algorithms: Nested Loop Join: Best for small inputs, can be optimized with ordered inner table. Merge Join: Best for medium to large inputs sorted inputs, or an output that needs to be ordered. Hash Join: Best for medium to large inputs, can be parallelized to scale linearly. LINQ Query: DataTable firstTable, secondTable; ... var rows = from firstRow in firstTable.AsEnumerable () join secondRow in secondTable.AsEnumerable () on firstRow.Field<object> (randomObject.Property) equals secondRow.Field<object> (randomObject.Property) select new {firstRow, secondRow}; SQL Query: SELECT * FROM firstTable fT INNER JOIN secondTable sT ON fT.Property = sT.Property Sql Server might use a Nested Loop Join if it knows there are a small number of rows from each table, a merge join if it knows one of the tables has an index, and Hash join if it knows there are a lot of rows on either table and neither has an index. Does Linq choose its algorithm for joins? or does it always use one?

    Read the article

  • Problem with LINQ query

    - by Niels Bosma
    The following works fine: (from e in db.EnquiryAreas from w in db.WorkTypes where w.HumanId != null && w.SeoPriority > 0 && e.HumanId != null && e.SeoPriority > 0 && db.Enquiries.Where(f => f.WhereId == e.Id && f.WhatId == w.Id && f.EnquiryPublished != null && f.StatusId != EnquiryMethods.STATUS_INACTIVE && f.StatusId != EnquiryMethods.STATUS_REMOVED && f.StatusId != EnquiryMethods.STATUS_REJECTED && f.StatusId != EnquiryMethods.STATUS_ATTEND ).Any() select new { EnquiryArea = e, WorkType = w }); But: (from e in db.EnquiryAreas from w in db.WorkTypes where w.HumanId != null && w.SeoPriority > 0 && e.HumanId != null && e.SeoPriority > 0 && EnquiryMethods.BlockOnSite(db.Enquiries.Where(f => f.WhereId == e.Id && f.WhatId == w.Id)).Any() select new { EnquiryArea = e, WorkType = w }); + public static IQueryable<Enquiry> BlockOnSite(IQueryable<Enquiry> linq) { return linq.Where(e => e.EnquiryPublished != null && e.StatusId != STATUS_INACTIVE && e.StatusId != STATUS_REMOVED && e.StatusId != STATUS_REJECTED && e.StatusId != STATUS_ATTEND ); } I get the following error: base {System.SystemException}: {"Method 'System.Linq.IQueryable1[X.Enquiry] BlockOnSite(System.Linq.IQueryable1[X.Enquiry])' has no supported translation to SQL."}

    Read the article

  • Advice on Linq to SQL mapping object design

    - by fearofawhackplanet
    I hope the title and following text are clear, I'm not very familiar with the correct terms so please correct me if I get anything wrong. I'm using Linq ORM for the first time and am wondering how to address the following. Say I have two DB tables: User ---- Id Name Phone ----- Id UserId Model The Linq code generator produces a bunch of entity classes. I then write my own classes and interfaces which wrap these Linq classes: class DatabaseUser : IUser { public DatabaseUser(User user) { _user = user; } public Guid Id { get { return _user.Id; } } ... etc } so far so good. Now it's easy enough to find a users phones from Phones.Where(p => p.User = user) but surely comsumers of the API shouldn't need to be writing their own Linq queries to get at data, so I should wrap this query in a function or property somewhere. So the question is, in this example, would you add a Phones property to IUser or not? In other words, should my interface specifically be modelling my database objects (in which case Phones doesn't belong in IUser), or are they actually simply providing a set of functions and properties which are conceptually associated with a User (in which case it does)? There seems drawbacks to both views, but I'm wondering if there is a standard approach to the problem. Or just any general words of wisdom you could share. My first thought was to use extension methods but in fact that doesn't work in this case.

    Read the article

  • com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Unknown command

    - by adisembiring
    Hi .. I'm trying to create datasource for connection pooling mysql database in Websphere Application Server. I've set the JDBC Provider, I set the Implementation class name : com.mysql.jdbc.jdbc2.optional.MysqlConnectionPoolDataSource my mysql driver 5.1.6. but I got this error while I try to connect the datasource: The test connection operation failed for data source btn_itb_ds on server server1 at node qnode with the following exception: com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Unknown command. View JVM logs for further details. I have read this http://bugs.mysql.com/bug.php?id=38388 trouble shooting. But they just suggest to upgrade mysql driver version 5.1.X and I have do that. but I've got the same error.

    Read the article

  • Logging to MySQL without empty rows/skipped records?

    - by Lee Ward
    I'm trying to figure out how to make Squid proxy log to MySQL. I know ACL order is pretty important but I'm not sure if I understand exactly what ACLs are or do, it's difficult to explain, but hopefully you'll see where I'm going with this as you read! I have created the lines to make Squid interact with a helper in squid.conf as follows: external_acl_type mysql_log %LOGIN %SRC %PROTO %URI php /etc/squid3/custom/mysql_lg.php acl ex_log external mysql_log http_access allow ex_log The external ACL helper (mysql_lg.php) is a PHP script and is as follows: error_reporting(0); if (! defined(STDIN)) { define("STDIN", fopen("php://stdin", "r")); } $res = mysql_connect('localhost', 'squid', 'testsquidpw'); $dbres = mysql_select_db('squid', $res); while (!feof(STDIN)) { $line = trim(fgets(STDIN)); $fields = explode(' ', $line); $user = rawurldecode($fields[0]); $cli_ip = rawurldecode($fields[1]); $protocol = rawurldecode($fields[2]); $uri = rawurldecode($fields[3]); $q = "INSERT INTO logs (id, user, cli_ip, protocol, url) VALUES ('', '".$user."', '".$cli_ip."', '".$protocol."', '".$uri."');"; mysql_query($q) or die (mysql_error()); if ($fault) { fwrite(STDOUT, "ERR\n"); }; fwrite(STDOUT, "OK\n"); } The configuration I have right now looks like this: ## Authentication Handler auth_param ntlm program /usr/bin/ntlm_auth --helper-protocol=squid-2.5-ntlmssp auth_param ntlm children 30 auth_param negotiate program /usr/bin/ntlm_auth --helper-protocol=squid-2.5-basic auth_param negotiate children 5 # Allow squid to update log external_acl_type mysql_log %LOGIN %SRC %PROTO %URI php /etc/squid3/custom/mysql_lg.php acl ex_log external mysql_log http_access allow ex_log acl localnet src 172.16.45.0/24 acl AuthorizedUsers proxy_auth REQUIRED acl SSL_ports port 443 acl Safe_ports port 80 # http acl Safe_ports port 21 # ftp acl Safe_ports port 443 # https acl CONNECT method CONNECT acl blockeddomain url_regex "/etc/squid3/bl.acl" http_access deny blockeddomain deny_info ERR_BAD_GENERAL blockeddomain # Deny requests to certain unsafe ports http_access deny !Safe_ports # Deny CONNECT to other than secure SSL ports http_access deny CONNECT !SSL_ports # Allow the internal network access to this proxy http_access allow localnet # Allow authorized users access to this proxy http_access allow AuthorizedUsers # FINAL RULE - Deny all other access to this proxy http_access deny all From testing, the closer to the bottom I place the logging lines the less it logs. Oftentimes, it even places empty rows in to the MySQL table. The file-based logs in /var/log/squid3/access.log are correct but many of the rows in the access logs are missing from the MySQL logs. I can't help but think it's down to the order I'm putting lines in because I want to log everything to MySQL, unauthenticated requests, blocked requests, which category blocked a specific request. The reason I want this in MySQL is because I'm trying to have everything managed via a custom web-based frontend and want to avoid using any shell commands and access to system log files if I can help it. The end result is to make it as easy as possible to maintain without keeping staff waiting on the phone whilst I add a new rule and reload the server! Hopefully someone can help me out here because this is very much a learning experience for me and I'm pretty stumped. Many thanks in advance for any help!

    Read the article

  • Import SQL dump into MySQL

    - by BryanWheelock
    I'm confused how to import a SQL dump file. I can't seem to import the database without creating the database first in MySQL. This is the error displayed when database_name has not yet been created: username = username of someone with access to the database on the original server. database_name = name of database from the original server $ mysql -u username -p -h localhost database_name < dumpfile.sql Enter password: ERROR 1049 (42000): Unknown database 'database_name' If I log into MySQL as root and create the database, database_name mysql -u root create database database_name; create user username;# same username as the user from the database I got the dump from. grant all privileges on database_name.* to username@"localhost" identified by 'password'; exit mysql then attempt to import the sql dump again: $ mysql -u username -p database_name < dumpfile.sql Enter password: ERROR 1007 (HY000) at line 21: Can't create database 'database_name'; database exists How am I supposed to import the SQL dumpfile?

    Read the article

  • Best way to install multiple versions of Apache, PHP and MySQL on a single FreeBSD host

    - by Mikael Roos
    I want a test- and development-environment for web using Apache, PHP and MySQL. I need to be able to test a single web-application with multiple versions of PHP (5.2, 5.3, etc) and multiple versions of MySQL (5.0, 5.1, 5.5, etc). It shall be hosted on a FreeBSD server. My idea is to compile each version into a directory structure and running them on separate portnumbers. For example: opt/apache2.2-php5.2-mysql-5.0 (httpd on port 8801, mysql on port 8802) (directory contains each software, compiled and linked towards eachother) opt/apache2.2-php5.3-mysql-5.1 (httpd on port 8803, mysql on port 8804) (and so on) Any thoughts or suggestions of the best way to setup this type of environment?

    Read the article

  • Is there anything else I can do to optimize this MySQL query?

    - by Legend
    I have two tables, Table A with 700,000 entries and Table B with 600,000 entries. The structure is as follows: Table A: +-----------+---------------------+------+-----+---------+----------------+ | Field | Type | Null | Key | Default | Extra | +-----------+---------------------+------+-----+---------+----------------+ | id | bigint(20) unsigned | NO | PRI | NULL | auto_increment | | number | bigint(20) unsigned | YES | | NULL | | +-----------+---------------------+------+-----+---------+----------------+ Table B: +-------------+---------------------+------+-----+---------+----------------+ | Field | Type | Null | Key | Default | Extra | +-------------+---------------------+------+-----+---------+----------------+ | id | bigint(20) unsigned | NO | PRI | NULL | auto_increment | | number_s | bigint(20) unsigned | YES | MUL | NULL | | | number_e | bigint(20) unsigned | YES | MUL | NULL | | | source | varchar(50) | YES | | NULL | | +-------------+---------------------+------+-----+---------+----------------+ I am trying to find if any of the values in Table A are present in Table B using the following code: $sql = "SELECT number from TableA"; $result = mysql_query($sql) or die(mysql_error()); while($row = mysql_fetch_assoc($result)) { $number = $row['number']; $sql = "SELECT source, count(source) FROM TableB WHERE number_s < $number AND number_e > $number GROUP BY source"; $re = mysql_query($sql) or die(mysql_error); while($ro = mysql_fetch_array($re)) { echo $number."\t".$ro[0]."\t".$ro[1]."\n"; } } I was hoping that the query would go fast but then for some reason, it isn't terrible fast. My explain on the select (with a particular value of "number") gives me the following: mysql> explain SELECT source, count(source) FROM TableB WHERE number_s < 1812194440 AND number_e > 1812194440 GROUP BY source; +----+-------------+------------+------+-------------------------+------+---------+------+--------+----------------------------------------------+ | id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra | +----+-------------+------------+------+-------------------------+------+---------+------+--------+----------------------------------------------+ | 1 | SIMPLE | TableB | ALL | number_s,number_e | NULL | NULL | NULL | 696325 | Using where; Using temporary; Using filesort | +----+-------------+------------+------+-------------------------+------+---------+------+--------+----------------------------------------------+ 1 row in set (0.00 sec) Is there any optimization that I can squeeze out of this? I tried writing a stored procedure for the same task but it doesn't even seem to work in the first place... It doesn't give any syntax errors... I tried running it for a day and it was still running which felt odd. CREATE PROCEDURE Filter() Begin DECLARE number BIGINT UNSIGNED; DECLARE x INT; DECLARE done INT DEFAULT 0; DECLARE cur1 CURSOR FOR SELECT number FROM TableA; DECLARE CONTINUE HANDLER FOR NOT FOUND SET done = 1; CREATE TEMPORARY TABLE IF NOT EXISTS Flags(number bigint unsigned, count int(11)); OPEN cur1; hist_loop: LOOP FETCH cur1 INTO number; SELECT count(*) from TableB WHERE number_s < number AND number_e > number INTO x; IF done = 1 THEN LEAVE hist_loop; END IF; IF x IS NOT NULL AND x>0 THEN INSERT INTO Flags(number, count) VALUES(number, x); END IF; END LOOP hist_loop; CLOSE cur1; END

    Read the article

  • MySql UDF using shared library won't load

    - by Jarrod
    I am attempting to create a mysql UDF which will match a fingerprint using Digital Persona's free linux SDK library. I have written a trivial UDF as a learning experience which worked fine. However, when I added a dependency to Digital Persona's shared object I can no longer get MySql to load my UDF. I added includes to DP's headers and compiled my UDF using: gcc -fPIC -Wall -I/usr/src/mysql-5.0.45-linux-i686-icc-glibc23/include -shared -o dp_udf.so dp_udf.cc I also tried adding the -static argument, but whenever I restart MySql, I get the error: Can't open shared library 'dp_udf.so' (errno: 0 /usr/local/mysql/lib/plugin/dp_udf.so: undefined symbol: MC_verifyFeaturesEx) MC_verifyFeaturesEx is a function defined "dpMatch.h" which I included, and is implemented in libdpfpapi.so which I have tried placing in the same location as my dp_udf.so and in /usr/lib. Am I doing something wrong with my call to gcc (my C++ skills are rusty) or does MySql not allow UDFs to use additional shared objects?

    Read the article

< Previous Page | 66 67 68 69 70 71 72 73 74 75 76 77  | Next Page >